[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Added Tests for ContentModelLogFormatter
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/402755 ) Change subject: Added Tests for ContentModelLogFormatter .. Added Tests for ContentModelLogFormatter Bug: T183900 Change-Id: I812b477eb45e19a06e5c18bc30da731f4af8cc8f --- A tests/phpunit/includes/logging/ContentModelLogFormatterTest.php 1 file changed, 60 insertions(+), 0 deletions(-) Approvals: Legoktm: Looks good to me, approved jenkins-bot: Verified diff --git a/tests/phpunit/includes/logging/ContentModelLogFormatterTest.php b/tests/phpunit/includes/logging/ContentModelLogFormatterTest.php new file mode 100644 index 000..17e5411 --- /dev/null +++ b/tests/phpunit/includes/logging/ContentModelLogFormatterTest.php @@ -0,0 +1,60 @@ + 'contentmodel', + 'action' => 'new', + 'comment' => 'new content model comment', + 'namespace' => NS_MAIN, + 'title' => 'ContentModelPage', + 'params' => [ + '5::newModel' => 'testcontentmodel', + ], + ], + [ + 'text' => 'User created the page ContentModelPage ' . + 'using a non-default content model ' . + '"testcontentmodel"', + 'api' => [ + 'newModel' => 'testcontentmodel', + ], + ], + ], + [ + [ + 'type' => 'contentmodel', + 'action' => 'change', + 'comment' => 'change content model comment', + 'namespace' => NS_MAIN, + 'title' => 'ContentModelPage', + 'params' => [ + '4::oldmodel' => 'wikitext', + '5::newModel' => 'testcontentmodel', + ], + ], + [ + 'text' => 'User changed the content model of the page ' . + 'ContentModelPage from "wikitext" to ' . + '"testcontentmodel"', + 'api' => [ + 'oldmodel' => 'wikitext', + 'newModel' => 'testcontentmodel', + ], + ], + ], + ]; + } + + /** +* @dataProvider provideContentModelLogDatabaseRows +*/ + public function testContentModelLogDatabaseRows( $row, $extra ) { + $this->doTestLogFormatter( $row, $extra ); + } +} -- To view, visit https://gerrit.wikimedia.org/r/402755 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I812b477eb45e19a06e5c18bc30da731f4af8cc8f Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Ryan10145Gerrit-Reviewer: Legoktm Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Added Tests for ContentModelLogFormatter
Ryan10145 has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/402755 ) Change subject: Added Tests for ContentModelLogFormatter .. Added Tests for ContentModelLogFormatter Bug: T183900 Change-Id: I812b477eb45e19a06e5c18bc30da731f4af8cc8f --- A tests/phpunit/includes/logging/ContentModelLogFormatterTest.php 1 file changed, 68 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/55/402755/1 diff --git a/tests/phpunit/includes/logging/ContentModelLogFormatterTest.php b/tests/phpunit/includes/logging/ContentModelLogFormatterTest.php new file mode 100644 index 000..a6fc91a --- /dev/null +++ b/tests/phpunit/includes/logging/ContentModelLogFormatterTest.php @@ -0,0 +1,68 @@ + 'contentmodel', + 'action' => 'new', + 'comment' => 'new content model comment', + 'namespace' => NS_MAIN, + 'title' => 'ContentModelPage', + 'params' => [ + '5::newModel' => 'testcontentmodel', + ], + ], + [ + 'text' => 'User created the page ContentModelPage using a non-default content model "testcontentmodel"', + 'api' => [ + 'newModel' => 'testcontentmodel', + ], + ], + ], + ]; + } + + /** +* @dataProvider provideNewLogDatabaseRows +*/ + public function testNewLogDatabaseRows( $row, $extra ) { + $this->doTestLogFormatter( $row, $extra ); + } + + public static function provideChangeLogDatabaseRows() { + return [ + [ + [ + 'type' => 'contentmodel', + 'action' => 'change', + 'comment' => 'change content model comment', + 'namespace' => NS_MAIN, + 'title' => 'ContentModelPage', + 'params' => [ + '4::oldmodel' => 'wikitext', + '5::newModel' => 'testcontentmodel', + ], + ], + [ + 'text' => 'User changed the content model of the page ContentModelPage from "wikitext" to "testcontentmodel"', + 'api' => [ + 'oldmodel' => 'wikitext', + 'newModel' => 'testcontentmodel', + ], + ], + ], + ]; + } + + /** +* @dataProvider provideChangeLogDatabaseRows +*/ + public function testChangeLogDatabaseRows( $row, $extra ) { + $this->doTestLogFormatter( $row, $extra ); + } +} -- To view, visit https://gerrit.wikimedia.org/r/402755 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I812b477eb45e19a06e5c18bc30da731f4af8cc8f Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Ryan10145___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits