Merge "Add MessagesBi.php"
[lhc/web/wiklou.git] / tests / phpunit / includes / specialpage / ChangesListSpecialPageTest.php
index 5118218..19a1875 100644 (file)
@@ -347,7 +347,7 @@ class ChangesListSpecialPageTest extends AbstractChangesListSpecialPageTestCase
                $user = $this->getTestSysop()->getUser();
                $this->assertConditions(
                        [ # expected
-                               'rc_patrolled = 0',
+                               'rc_patrolled' => 0,
                        ],
                        [
                                'hidepatrolled' => 1,
@@ -361,7 +361,7 @@ class ChangesListSpecialPageTest extends AbstractChangesListSpecialPageTestCase
                $user = $this->getTestSysop()->getUser();
                $this->assertConditions(
                        [ # expected
-                               'rc_patrolled != 0',
+                               'rc_patrolled' => [ 1, 2 ],
                        ],
                        [
                                'hideunpatrolled' => 1,
@@ -371,6 +371,30 @@ class ChangesListSpecialPageTest extends AbstractChangesListSpecialPageTestCase
                );
        }
 
+       public function testRcReviewStatusFilter() {
+               $user = $this->getTestSysop()->getUser();
+               $this->assertConditions(
+                       [ #expected
+                               'rc_patrolled' => 1,
+                       ],
+                       [
+                               'reviewStatus' => 'manual'
+                       ],
+                       "rc conditions: reviewStatus=manual",
+                       $user
+               );
+               $this->assertConditions(
+                       [ #expected
+                               'rc_patrolled' => [ 0, 2 ],
+                       ],
+                       [
+                               'reviewStatus' => 'unpatrolled;auto'
+                       ],
+                       "rc conditions: reviewStatus=unpatrolled;auto",
+                       $user
+               );
+       }
+
        public function testRcHideminorFilter() {
                $this->assertConditions(
                        [ # expected
@@ -649,43 +673,6 @@ class ChangesListSpecialPageTest extends AbstractChangesListSpecialPageTestCase
                return $now - $days * $secondsPerDay;
        }
 
-       public function testGetFilterGroupDefinitionFromLegacyCustomFilters() {
-               $customFilters = [
-                       'hidefoo' => [
-                               'msg' => 'showhidefoo',
-                               'default' => true,
-                       ],
-
-                       'hidebar' => [
-                               'msg' => 'showhidebar',
-                               'default' => false,
-                       ],
-               ];
-
-               $this->assertEquals(
-                       [
-                               'name' => 'unstructured',
-                               'class' => ChangesListBooleanFilterGroup::class,
-                               'priority' => -1,
-                               'filters' => [
-                                       [
-                                               'name' => 'hidefoo',
-                                               'showHide' => 'showhidefoo',
-                                               'default' => true,
-                                       ],
-                                       [
-                                               'name' => 'hidebar',
-                                               'showHide' => 'showhidebar',
-                                               'default' => false,
-                                       ]
-                               ],
-                       ],
-                       $this->changesListSpecialPage->getFilterGroupDefinitionFromLegacyCustomFilters(
-                               $customFilters
-                       )
-               );
-       }
-
        public function testGetStructuredFilterJsData() {
                $this->changesListSpecialPage->filterGroups = [];