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 0000000..a6fc91a
--- /dev/null
+++ b/tests/phpunit/includes/logging/ContentModelLogFormatterTest.php
@@ -0,0 +1,68 @@
+<?php
+
+/**
+ * @covers ContentModelLogFormatter
+ */
+class ContentModelLogFormatterTest extends LogFormatterTestCase {
+       public static function provideNewLogDatabaseRows() {
+               return [
+                       [
+                               [
+                                       'type' => '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 <chang.ryan10...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to