Merge "Allow SVGs using an older proposed recommendation DTD"
[lhc/web/wiklou.git] / tests / phpunit / includes / changes / ChangesListFilterTest.php
index b63482f..0015453 100644 (file)
@@ -1,5 +1,7 @@
 <?php
 
+use Wikimedia\TestingAccessWrapper;
+
 /**
  * @covers ChangesListFilter
  */
@@ -21,7 +23,46 @@ class ChangesListFilterTest extends MediaWikiTestCase {
                                'filters' => [],
                        ]
                );
+       }
+
+       // @codingStandardsIgnoreStart
+       /**
+        * @expectedException MWException
+        * @expectedExceptionMessage Filter names may not contain '_'.  Use the naming convention: 'lowercase'
+        */
+       // @codingStandardsIgnoreEnd
+       public function testReservedCharacter() {
+               $filter = new MockChangesListFilter(
+                       [
+                               'group' => $this->group,
+                               'name' => 'some_name',
+                               'priority' => 1,
+                       ]
+               );
+       }
+
+       // @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,
+                       ]
+               );
        }
 
        /**