Addshore has uploaded a new change for review. https://gerrit.wikimedia.org/r/117249
Change subject: Split MessageTest::testMessageParamTypes ...................................................................... Split MessageTest::testMessageParamTypes Change-Id: I2099fa8a27a88bceb77c25e1ee08fb71eca318dc --- M tests/phpunit/includes/MessageTest.php 1 file changed, 39 insertions(+), 10 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/49/117249/1 diff --git a/tests/phpunit/includes/MessageTest.php b/tests/phpunit/includes/MessageTest.php index 71ebd6a..3086ff1 100644 --- a/tests/phpunit/includes/MessageTest.php +++ b/tests/phpunit/includes/MessageTest.php @@ -77,55 +77,84 @@ } /** - * FIXME: This should not need database, but Language#formatExpiry does (bug 55912) - * @group Database - * @todo this should be split up into multiple test methods * @covers Message::numParams - * @covers Message::durationParams - * @covers Message::expiryParams - * @covers Message::timeperiodParams - * @covers Message::sizeParams - * @covers Message::bitrateParams */ - public function testMessageParamTypes() { + public function testMessageNumParams() { $lang = Language::factory( 'en' ); - $msg = new RawMessage( '$1' ); + $this->assertEquals( $lang->formatNum( 123456.789 ), $msg->inLanguage( $lang )->numParams( 123456.789 )->plain(), 'numParams is handled correctly' ); + } + /** + * @covers Message::durationParams + */ + public function testMessageDurationParams() { + $lang = Language::factory( 'en' ); $msg = new RawMessage( '$1' ); + $this->assertEquals( $lang->formatDuration( 1234 ), $msg->inLanguage( $lang )->durationParams( 1234 )->plain(), 'durationParams is handled correctly' ); + } + /** + * FIXME: This should not need database, but Language#formatExpiry does (bug 55912) + * @group Database + * @covers Message::expiryParams + */ + public function testMessageExpiryParams() { + $lang = Language::factory( 'en' ); $msg = new RawMessage( '$1' ); + $this->assertEquals( $lang->formatExpiry( wfTimestampNow() ), $msg->inLanguage( $lang )->expiryParams( wfTimestampNow() )->plain(), 'expiryParams is handled correctly' ); + } + /** + * @covers Message::timeperiodParams + */ + public function testMessageTimeperiodParams() { + $lang = Language::factory( 'en' ); $msg = new RawMessage( '$1' ); + $this->assertEquals( $lang->formatTimePeriod( 1234 ), $msg->inLanguage( $lang )->timeperiodParams( 1234 )->plain(), 'timeperiodParams is handled correctly' ); + } + /** + * @covers Message::sizeParams + */ + public function testMessageSizeParams() { + $lang = Language::factory( 'en' ); $msg = new RawMessage( '$1' ); + $this->assertEquals( $lang->formatSize( 123456 ), $msg->inLanguage( $lang )->sizeParams( 123456 )->plain(), 'sizeParams is handled correctly' ); + } + /** + * @covers Message::bitrateParams + */ + public function testMessageBitrateParams() { + $lang = Language::factory( 'en' ); $msg = new RawMessage( '$1' ); + $this->assertEquals( $lang->formatBitrate( 123456 ), $msg->inLanguage( $lang )->bitrateParams( 123456 )->plain(), -- To view, visit https://gerrit.wikimedia.org/r/117249 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2099fa8a27a88bceb77c25e1ee08fb71eca318dc Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Addshore <addshorew...@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits