CONTENT_MODEL_CSS,
CONTENT_MODEL_JAVASCRIPT,
],
- 'wgTidyConfig' => [ 'driver' => 'disabled' ],
+ 'wgTidyConfig' => [ 'driver' => 'RemexHtml' ],
'wgCapitalLinks' => true,
'wgHooks' => [], // bypass hook ContentGetParserOutput that force custom rendering
] );
parent::tearDown();
}
+ /**
+ * @param string $text
+ * @return TextContent
+ */
public function newContent( $text ) {
return new TextContent( $text );
}
$options
);
- $this->assertEquals( $expected, $content->getNativeData() );
+ $this->assertEquals( $expected, $content->getText() );
}
public static function dataPreloadTransform() {
$content = $this->newContent( $text );
$content = $content->preloadTransform( $this->context->getTitle(), $options );
- $this->assertEquals( $expected, $content->getNativeData() );
+ $this->assertEquals( $expected, $content->getText() );
}
public static function dataGetRedirectTarget() {
$copy = $content->copy();
$this->assertTrue( $content->equals( $copy ), 'copy must be equal to original' );
- $this->assertEquals( 'hello world.', $copy->getNativeData() );
+ $this->assertEquals( 'hello world.', $copy->getText() );
}
/**
$this->assertEquals( 12, $content->getSize() );
}
+ /**
+ * @covers TextContent::getText
+ */
+ public function testGetText() {
+ $content = $this->newContent( 'hello world.' );
+
+ $this->assertEquals( 'hello world.', $content->getText() );
+ }
+
/**
* @covers TextContent::getNativeData
*/
public function testGetNativeData() {
$content = $this->newContent( 'hello world.' );
- $this->assertEquals( 'hello world.', $content->getNativeData() );
+ $this->assertEquals( 'hello world.', $content->getText() );
}
/**
public function testConvert( $text, $model, $lossy, $expectedNative ) {
$content = $this->newContent( $text );
+ /** @var TextContent $converted */
$converted = $content->convert( $model, $lossy );
if ( $expectedNative === false ) {
$this->assertFalse( $converted, "conversion to $model was expected to fail!" );
} else {
$this->assertInstanceOf( Content::class, $converted );
- $this->assertEquals( $expectedNative, $converted->getNativeData() );
+ $this->assertEquals( $expectedNative, $converted->getText() );
}
}
];
}
+ /**
+ * @covers TextContent::__construct
+ * @covers TextContentHandler::serializeContent
+ */
+ public function testSerialize() {
+ $cnt = $this->newContent( 'testing text' );
+
+ $this->assertSame( 'testing text', $cnt->serialize() );
+ }
+
}