Krinkle has uploaded a new change for review. https://gerrit.wikimedia.org/r/177170
Change subject: content: Re-arange tests to declare data provider first ...................................................................... content: Re-arange tests to declare data provider first For consistency with other test suites. Change-Id: Ic4b4d8e228a9ce82a42a07d88d690a9c932960c3 --- M tests/phpunit/includes/content/JsonContentTest.php 1 file changed, 23 insertions(+), 23 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/70/177170/1 diff --git a/tests/phpunit/includes/content/JsonContentTest.php b/tests/phpunit/includes/content/JsonContentTest.php index 77b542f..d4151a5 100644 --- a/tests/phpunit/includes/content/JsonContentTest.php +++ b/tests/phpunit/includes/content/JsonContentTest.php @@ -6,15 +6,6 @@ */ class JsonContentTest extends MediaWikiLangTestCase { - /** - * @dataProvider provideValidConstruction - */ - public function testValidConstruct( $text, $modelId, $isValid, $expected ) { - $obj = new JsonContent( $text, $modelId ); - $this->assertEquals( $isValid, $obj->isValid() ); - $this->assertEquals( $expected, $obj->getJsonData() ); - } - public static function provideValidConstruction() { return array( array( 'foo', CONTENT_MODEL_JSON, false, null ), @@ -24,11 +15,12 @@ } /** - * @dataProvider provideDataToEncode + * @dataProvider provideValidConstruction */ - public function testBeautifyUsesFormatJson( $data ) { - $obj = new JsonContent( FormatJson::encode( $data ) ); - $this->assertEquals( FormatJson::encode( $data, true ), $obj->beautifyJSON() ); + public function testValidConstruct( $text, $modelId, $isValid, $expected ) { + $obj = new JsonContent( $text, $modelId ); + $this->assertEquals( $isValid, $obj->isValid() ); + $this->assertEquals( $expected, $obj->getJsonData() ); } public static function provideDataToEncode() { @@ -39,6 +31,14 @@ array( array( 'baz' => 'foo', 'bar' ) ), array( array( 'baz' => 1000, 'bar' ) ), ); + } + + /** + * @dataProvider provideDataToEncode + */ + public function testBeautifyUsesFormatJson( $data ) { + $obj = new JsonContent( FormatJson::encode( $data ) ); + $this->assertEquals( FormatJson::encode( $data, true ), $obj->beautifyJSON() ); } /** @@ -65,16 +65,6 @@ return $this->getMockBuilder( 'ParserOptions' ) ->disableOriginalConstructor() ->getMock(); - } - - /** - * @dataProvider provideDataAndParserText - */ - public function testFillParserOutput( $data, $expected ) { - $obj = new JsonContent( FormatJson::encode( $data ) ); - $parserOutput = $obj->getParserOutput( $this->getMockTitle(), null, null, true ); - $this->assertInstanceOf( 'ParserOutput', $parserOutput ); - $this->assertEquals( $expected, $parserOutput->getText() ); } public static function provideDataAndParserText() { @@ -111,4 +101,14 @@ ), ); } + + /** + * @dataProvider provideDataAndParserText + */ + public function testFillParserOutput( $data, $expected ) { + $obj = new JsonContent( FormatJson::encode( $data ) ); + $parserOutput = $obj->getParserOutput( $this->getMockTitle(), null, null, true ); + $this->assertInstanceOf( 'ParserOutput', $parserOutput ); + $this->assertEquals( $expected, $parserOutput->getText() ); + } } -- To view, visit https://gerrit.wikimedia.org/r/177170 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic4b4d8e228a9ce82a42a07d88d690a9c932960c3 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Krinkle <krinklem...@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits