Allow Message::newFromSpecifier to handle ApiMessages
authorBrad Jorsch <bjorsch@wikimedia.org>
Tue, 21 Jun 2016 15:12:53 +0000 (11:12 -0400)
committerBrad Jorsch <bjorsch@wikimedia.org>
Tue, 28 Jun 2016 16:15:27 +0000 (12:15 -0400)
commit5f01cbb3ad0676a4b6e3a7d33d4181558c92d3d7
treee1077bd852ad27d2d45c028ad188a7b744844793
parent2c10ff9a9c1164e0c0a795bb53c29aa05004290a
Allow Message::newFromSpecifier to handle ApiMessages

Instead of constructing a new Message from the Message as
a MessageSpecifier, just clone the existing Message which will preserve
subclass data.

Also, make use of this to simplify the logic in ApiBase::parseMsg().

Change-Id: I9545acb8da752c0c21e16d8b1d37d8802fcb329d
includes/Message.php
includes/api/ApiBase.php
includes/api/ApiUpload.php
tests/phpunit/includes/MessageTest.php