Fix php code style
[lhc/web/wiklou.git] / tests / phpunit / includes / changes / ChangesListFilterTest.php
index c212560..0015453 100644 (file)
@@ -1,5 +1,7 @@
 <?php
 
+use Wikimedia\TestingAccessWrapper;
+
 /**
  * @covers ChangesListFilter
  */
@@ -21,7 +23,6 @@ class ChangesListFilterTest extends MediaWikiTestCase {
                                'filters' => [],
                        ]
                );
-
        }
 
        // @codingStandardsIgnoreStart
@@ -40,6 +41,30 @@ class ChangesListFilterTest extends MediaWikiTestCase {
                );
        }
 
+       // @codingStandardsIgnoreStart
+       /**
+        * @expectedException MWException
+        * @expectedExceptionMessage Two filters in a group cannot have the same name: 'somename'
+        */
+       // @codingStandardsIgnoreEnd
+       public function testDuplicateName() {
+               new MockChangesListFilter(
+                       [
+                               'group' => $this->group,
+                               'name' => 'somename',
+                               'priority' => 1,
+                       ]
+               );
+
+               new MockChangesListFilter(
+                       [
+                               'group' => $this->group,
+                               'name' => 'somename',
+                               'priority' => 2,
+                       ]
+               );
+       }
+
        /**
         * @expectedException MWException
         * @expectedExceptionMessage Supersets can only be defined for filters in the same group