X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Fspecialpage%2FChangesListSpecialPageTest.php;h=19a1875d58eba8993fb7f8fb60b2dd4766f04279;hb=4df0c71911500466a6330b8fe29c623ef5b51e41;hp=51182180a9cf90d9eec05c1a45d244f4cd4e8b6f;hpb=a8e1051d4c47f8c5b2c55b072f903fdc0469849e;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/specialpage/ChangesListSpecialPageTest.php b/tests/phpunit/includes/specialpage/ChangesListSpecialPageTest.php index 51182180a9..19a1875d58 100644 --- a/tests/phpunit/includes/specialpage/ChangesListSpecialPageTest.php +++ b/tests/phpunit/includes/specialpage/ChangesListSpecialPageTest.php @@ -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 = [];