Tpt has uploaded a new change for review. https://gerrit.wikimedia.org/r/284859
Change subject: Adds some roundtrip tests to Page: content serialization ...................................................................... Adds some roundtrip tests to Page: content serialization Change-Id: Ia59ffc41f4bb863a6edd96faf029c37f1787c45a --- M tests/includes/page/PageContentHandlerTest.php 1 file changed, 22 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ProofreadPage refs/changes/59/284859/1 diff --git a/tests/includes/page/PageContentHandlerTest.php b/tests/includes/page/PageContentHandlerTest.php index e8b3cde..5a04b19 100644 --- a/tests/includes/page/PageContentHandlerTest.php +++ b/tests/includes/page/PageContentHandlerTest.php @@ -61,6 +61,17 @@ ); } + /** + * @dataProvider pageWikitextSerializationProvider + */ + public function testRoundTripSerializeContentInWikitext( $header, $body, $footer, $level, $proofreader, $text ) { + $content = PageContentTest::newContent( $header, $body, $footer, $level, $proofreader ); + $this->assertEquals( + $content, + $this->handler->unserializeContent( $this->handler->serializeContent( $text ) ) + ); + } + public function testSerializeContentInJson() { $pageContent = PageContentTest::newContent( 'Foo', 'Bar', 'FooBar', 2, '1.2.3.4' ); @@ -145,6 +156,17 @@ $this->handler->unserializeContent( $text, CONTENT_FORMAT_JSON ); } + /** + * @dataProvider pageJsonSerializationProvider + */ + public function testRoundTripSerializeContentInJson( $header, $body, $footer, $level, $proofreader, $text ) { + $content = PageContentTest::newContent( $header, $body, $footer, $level, $proofreader ); + $this->assertEquals( + $content, + $this->handler->unserializeContent( $this->handler->serializeContent( $text, CONTENT_FORMAT_JSON ), CONTENT_FORMAT_JSON ) + ); + } + public function testMakeEmptyContent() { $content = $this->handler->makeEmptyContent(); $this->assertTrue( $content->isEmpty() ); -- To view, visit https://gerrit.wikimedia.org/r/284859 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia59ffc41f4bb863a6edd96faf029c37f1787c45a Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/ProofreadPage Gerrit-Branch: master Gerrit-Owner: Tpt <thoma...@hotmail.fr> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits