For consistency with other test suites.
Change-Id: Ic4b4d8e228a9ce82a42a07d88d690a9c932960c3
*/
class JsonContentTest extends MediaWikiLangTestCase {
*/
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 ),
public static function provideValidConstruction() {
return array(
array( 'foo', CONTENT_MODEL_JSON, false, null ),
- * @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() {
}
public static function provideDataToEncode() {
+ /**
+ * @dataProvider provideDataToEncode
+ */
+ public function testBeautifyUsesFormatJson( $data ) {
+ $obj = new JsonContent( FormatJson::encode( $data ) );
+ $this->assertEquals( FormatJson::encode( $data, true ), $obj->beautifyJSON() );
+ }
+
/**
* @dataProvider provideDataToEncode
*/
/**
* @dataProvider provideDataToEncode
*/
- /**
- * @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() {
return array(
array(
public static function provideDataAndParserText() {
return array(
array(
+
+ /**
+ * @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() );
+ }