From 6cdddfe33019a9bb4cb91168b179e63abc50e67e Mon Sep 17 00:00:00 2001 From: ryan10145 Date: Sun, 7 Jan 2018 17:54:34 -0500 Subject: [PATCH] Added Tests for ContentModelLogFormatter Bug: T183900 Change-Id: I812b477eb45e19a06e5c18bc30da731f4af8cc8f --- .../logging/ContentModelLogFormatterTest.php | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 tests/phpunit/includes/logging/ContentModelLogFormatterTest.php diff --git a/tests/phpunit/includes/logging/ContentModelLogFormatterTest.php b/tests/phpunit/includes/logging/ContentModelLogFormatterTest.php new file mode 100644 index 0000000000..17e5411504 --- /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 ); + } +} -- 2.20.1