3 use Wikimedia\TestingAccessWrapper
;
6 * Test class for ChangesListSpecialPage class
8 * Copyright © 2011-, Antoine Musso, Stephane Bisson, Matthew Flaschen
10 * @author Antoine Musso
11 * @author Stephane Bisson
12 * @author Matthew Flaschen
15 * @covers ChangesListSpecialPage
17 class ChangesListSpecialPageTest
extends AbstractChangesListSpecialPageTestCase
{
18 protected function getPage() {
19 $mock = $this->getMockBuilder( ChangesListSpecialPage
::class )
22 'ChangesListSpecialPage',
26 ->setMethods( [ 'getPageTitle' ] )
27 ->getMockForAbstractClass();
29 $mock->method( 'getPageTitle' )->willReturn(
30 Title
::makeTitle( NS_SPECIAL
, 'ChangesListSpecialPage' )
33 $mock = TestingAccessWrapper
::newFromObject(
40 private function buildQuery(
41 $requestOptions = null,
44 $context = new RequestContext
;
45 $context->setRequest( new FauxRequest( $requestOptions ) );
47 $context->setUser( $user );
50 $this->changesListSpecialPage
->setContext( $context );
51 $this->changesListSpecialPage
->filterGroups
= [];
52 $formOptions = $this->changesListSpecialPage
->setup( null );
54 # Filter out rc_timestamp conditions which depends on the test runtime
55 # This condition is not needed as of march 2, 2011 -- hashar
56 # @todo FIXME: Find a way to generate the correct rc_timestamp
60 $queryConditions = [];
65 [ $this->changesListSpecialPage
, 'buildQuery' ],
76 $queryConditions = array_filter(
78 'ChangesListSpecialPageTest::filterOutRcTimestampCondition'
81 return $queryConditions;
84 /** helper to test SpecialRecentchanges::buildQuery() */
85 private function assertConditions(
87 $requestOptions = null,
91 $queryConditions = $this->buildQuery( $requestOptions, $user );
94 self
::normalizeCondition( $expected ),
95 self
::normalizeCondition( $queryConditions ),
100 private static function normalizeCondition( $conds ) {
101 $dbr = wfGetDB( DB_REPLICA
);
102 $normalized = array_map(
103 function ( $k, $v ) use ( $dbr ) {
104 if ( is_array( $v ) ) {
107 // (Ab)use makeList() to format only this entry
108 return $dbr->makeList( [ $k => $v ], Database
::LIST_AND
);
110 array_keys( $conds ),
117 /** return false if condition begins with 'rc_timestamp ' */
118 private static function filterOutRcTimestampCondition( $var ) {
119 return ( is_array( $var ) ||
strpos( $var, 'rc_timestamp ' ) === false );
122 public function testRcNsFilter() {
123 $this->assertConditions(
125 "rc_namespace = '0'",
128 'namespace' => NS_MAIN
,
130 "rc conditions with one namespace"
134 public function testRcNsFilterInversion() {
135 $this->assertConditions(
137 "rc_namespace != '0'",
140 'namespace' => NS_MAIN
,
143 "rc conditions with namespace inverted"
147 public function testRcNsFilterMultiple() {
148 $this->assertConditions(
150 "rc_namespace IN ('1','2','3')",
153 'namespace' => '1;2;3',
155 "rc conditions with multiple namespaces"
159 public function testRcNsFilterMultipleAssociated() {
160 $this->assertConditions(
162 "rc_namespace IN ('0','1','4','5','6','7')",
165 'namespace' => '1;4;7',
168 "rc conditions with multiple namespaces and associated"
172 public function testRcNsFilterMultipleAssociatedInvert() {
173 $this->assertConditions(
175 "rc_namespace NOT IN ('2','3','8','9')",
178 'namespace' => '2;3;9',
182 "rc conditions with multiple namespaces, associated and inverted"
186 public function testRcNsFilterMultipleInvert() {
187 $this->assertConditions(
189 "rc_namespace NOT IN ('1','2','3')",
192 'namespace' => '1;2;3',
195 "rc conditions with multiple namespaces inverted"
199 public function testRcHidemyselfFilter() {
200 $this->setMwGlobals( 'wgActorTableSchemaMigrationStage', SCHEMA_COMPAT_NEW
);
201 $this->overrideMwServices();
203 $user = $this->getTestUser()->getUser();
204 $user->getActorId( wfGetDB( DB_MASTER
) );
205 $this->assertConditions(
207 "NOT((rc_actor = '{$user->getActorId()}'))",
212 "rc conditions: hidemyself=1 (logged in)",
216 $user = User
::newFromName( '10.11.12.13', false );
217 $id = $user->getActorId( wfGetDB( DB_MASTER
) );
218 $this->assertConditions(
220 "NOT((rc_actor = '{$user->getActorId()}'))",
225 "rc conditions: hidemyself=1 (anon)",
230 public function testRcHidemyselfFilter_old() {
232 'wgActorTableSchemaMigrationStage', SCHEMA_COMPAT_WRITE_BOTH | SCHEMA_COMPAT_READ_OLD
234 $this->overrideMwServices();
236 $user = $this->getTestUser()->getUser();
237 $user->getActorId( wfGetDB( DB_MASTER
) );
238 $this->assertConditions(
240 "NOT((rc_user = '{$user->getId()}'))",
245 "rc conditions: hidemyself=1 (logged in)",
249 $user = User
::newFromName( '10.11.12.13', false );
250 $id = $user->getActorId( wfGetDB( DB_MASTER
) );
251 $this->assertConditions(
253 "NOT((rc_user_text = '10.11.12.13'))",
258 "rc conditions: hidemyself=1 (anon)",
263 public function testRcHidebyothersFilter() {
264 $this->setMwGlobals( 'wgActorTableSchemaMigrationStage', SCHEMA_COMPAT_NEW
);
265 $this->overrideMwServices();
267 $user = $this->getTestUser()->getUser();
268 $user->getActorId( wfGetDB( DB_MASTER
) );
269 $this->assertConditions(
271 "(rc_actor = '{$user->getActorId()}')",
276 "rc conditions: hidebyothers=1 (logged in)",
280 $user = User
::newFromName( '10.11.12.13', false );
281 $id = $user->getActorId( wfGetDB( DB_MASTER
) );
282 $this->assertConditions(
284 "(rc_actor = '{$user->getActorId()}')",
289 "rc conditions: hidebyothers=1 (anon)",
294 public function testRcHidebyothersFilter_old() {
296 'wgActorTableSchemaMigrationStage', SCHEMA_COMPAT_WRITE_BOTH | SCHEMA_COMPAT_READ_OLD
298 $this->overrideMwServices();
300 $user = $this->getTestUser()->getUser();
301 $user->getActorId( wfGetDB( DB_MASTER
) );
302 $this->assertConditions(
304 "(rc_user_text = '{$user->getName()}')",
309 "rc conditions: hidebyothers=1 (logged in)",
313 $user = User
::newFromName( '10.11.12.13', false );
314 $id = $user->getActorId( wfGetDB( DB_MASTER
) );
315 $this->assertConditions(
317 "(rc_user_text = '10.11.12.13')",
322 "rc conditions: hidebyothers=1 (anon)",
327 public function testRcHidepageedits() {
328 $this->assertConditions(
333 'hidepageedits' => 1,
335 "rc conditions: hidepageedits=1"
339 public function testRcHidenewpages() {
340 $this->assertConditions(
347 "rc conditions: hidenewpages=1"
351 public function testRcHidelog() {
352 $this->assertConditions(
359 "rc conditions: hidelog=1"
363 public function testRcHidehumans() {
364 $this->assertConditions(
372 "rc conditions: hidebots=0 hidehumans=1"
376 public function testRcHidepatrolledDisabledFilter() {
377 $this->setMwGlobals( 'wgUseRCPatrol', false );
378 $user = $this->getTestUser()->getUser();
379 $this->assertConditions(
383 'hidepatrolled' => 1,
385 "rc conditions: hidepatrolled=1 (user not allowed)",
390 public function testRcHideunpatrolledDisabledFilter() {
391 $this->setMwGlobals( 'wgUseRCPatrol', false );
392 $user = $this->getTestUser()->getUser();
393 $this->assertConditions(
397 'hideunpatrolled' => 1,
399 "rc conditions: hideunpatrolled=1 (user not allowed)",
403 public function testRcHidepatrolledFilter() {
404 $user = $this->getTestSysop()->getUser();
405 $this->assertConditions(
410 'hidepatrolled' => 1,
412 "rc conditions: hidepatrolled=1",
417 public function testRcHideunpatrolledFilter() {
418 $user = $this->getTestSysop()->getUser();
419 $this->assertConditions(
421 'rc_patrolled' => [ 1, 2 ],
424 'hideunpatrolled' => 1,
426 "rc conditions: hideunpatrolled=1",
431 public function testRcReviewStatusFilter() {
432 $user = $this->getTestSysop()->getUser();
433 $this->assertConditions(
438 'reviewStatus' => 'manual'
440 "rc conditions: reviewStatus=manual",
443 $this->assertConditions(
445 'rc_patrolled' => [ 0, 2 ],
448 'reviewStatus' => 'unpatrolled;auto'
450 "rc conditions: reviewStatus=unpatrolled;auto",
455 public function testRcHideminorFilter() {
456 $this->assertConditions(
463 "rc conditions: hideminor=1"
467 public function testRcHidemajorFilter() {
468 $this->assertConditions(
475 "rc conditions: hidemajor=1"
479 public function testHideCategorization() {
480 $this->assertConditions(
486 'hidecategorization' => 1
488 "rc conditions: hidecategorization=1"
492 public function testFilterUserExpLevelAll() {
493 $this->assertConditions(
498 'userExpLevel' => 'registered;unregistered;newcomer;learner;experienced',
500 "rc conditions: userExpLevel=registered;unregistered;newcomer;learner;experienced"
504 public function testFilterUserExpLevelRegisteredUnregistered() {
505 $this->assertConditions(
510 'userExpLevel' => 'registered;unregistered',
512 "rc conditions: userExpLevel=registered;unregistered"
516 public function testFilterUserExpLevelRegisteredUnregisteredLearner() {
517 $this->assertConditions(
522 'userExpLevel' => 'registered;unregistered;learner',
524 "rc conditions: userExpLevel=registered;unregistered;learner"
528 public function testFilterUserExpLevelAllExperienceLevels() {
529 $this->setMwGlobals( 'wgActorTableSchemaMigrationStage', SCHEMA_COMPAT_NEW
);
530 $this->overrideMwServices();
532 $this->assertConditions(
535 'actor_rc_user.actor_user IS NOT NULL',
538 'userExpLevel' => 'newcomer;learner;experienced',
540 "rc conditions: userExpLevel=newcomer;learner;experienced"
544 public function testFilterUserExpLevelAllExperienceLevels_old() {
546 'wgActorTableSchemaMigrationStage', SCHEMA_COMPAT_WRITE_BOTH | SCHEMA_COMPAT_READ_OLD
548 $this->overrideMwServices();
550 $this->assertConditions(
556 'userExpLevel' => 'newcomer;learner;experienced',
558 "rc conditions: userExpLevel=newcomer;learner;experienced"
562 public function testFilterUserExpLevelRegistrered() {
563 $this->setMwGlobals( 'wgActorTableSchemaMigrationStage', SCHEMA_COMPAT_NEW
);
564 $this->overrideMwServices();
566 $this->assertConditions(
569 'actor_rc_user.actor_user IS NOT NULL',
572 'userExpLevel' => 'registered',
574 "rc conditions: userExpLevel=registered"
578 public function testFilterUserExpLevelRegistrered_old() {
580 'wgActorTableSchemaMigrationStage', SCHEMA_COMPAT_WRITE_BOTH | SCHEMA_COMPAT_READ_OLD
582 $this->overrideMwServices();
584 $this->assertConditions(
590 'userExpLevel' => 'registered',
592 "rc conditions: userExpLevel=registered"
596 public function testFilterUserExpLevelUnregistrered() {
597 $this->setMwGlobals( 'wgActorTableSchemaMigrationStage', SCHEMA_COMPAT_NEW
);
598 $this->overrideMwServices();
600 $this->assertConditions(
603 'actor_rc_user.actor_user IS NULL',
606 'userExpLevel' => 'unregistered',
608 "rc conditions: userExpLevel=unregistered"
612 public function testFilterUserExpLevelUnregistrered_old() {
614 'wgActorTableSchemaMigrationStage', SCHEMA_COMPAT_WRITE_BOTH | SCHEMA_COMPAT_READ_OLD
616 $this->overrideMwServices();
618 $this->assertConditions(
624 'userExpLevel' => 'unregistered',
626 "rc conditions: userExpLevel=unregistered"
630 public function testFilterUserExpLevelRegistreredOrLearner() {
631 $this->setMwGlobals( 'wgActorTableSchemaMigrationStage', SCHEMA_COMPAT_NEW
);
632 $this->overrideMwServices();
634 $this->assertConditions(
637 'actor_rc_user.actor_user IS NOT NULL',
640 'userExpLevel' => 'registered;learner',
642 "rc conditions: userExpLevel=registered;learner"
646 public function testFilterUserExpLevelRegistreredOrLearner_old() {
648 'wgActorTableSchemaMigrationStage', SCHEMA_COMPAT_WRITE_BOTH | SCHEMA_COMPAT_READ_OLD
650 $this->overrideMwServices();
652 $this->assertConditions(
658 'userExpLevel' => 'registered;learner',
660 "rc conditions: userExpLevel=registered;learner"
664 public function testFilterUserExpLevelUnregistreredOrExperienced() {
665 $this->setMwGlobals( 'wgActorTableSchemaMigrationStage', SCHEMA_COMPAT_NEW
);
666 $this->overrideMwServices();
668 $conds = $this->buildQuery( [ 'userExpLevel' => 'unregistered;experienced' ] );
671 '/\(actor_rc_user\.actor_user IS NULL\) OR '
672 . '\(\(user_editcount >= 500\) AND \(user_registration <= \'[^\']+\'\)\)/',
674 "rc conditions: userExpLevel=unregistered;experienced"
678 public function testFilterUserExpLevelUnregistreredOrExperienced_old() {
680 'wgActorTableSchemaMigrationStage', SCHEMA_COMPAT_WRITE_BOTH | SCHEMA_COMPAT_READ_OLD
682 $this->overrideMwServices();
684 $conds = $this->buildQuery( [ 'userExpLevel' => 'unregistered;experienced' ] );
687 '/\(rc_user = 0\) OR '
688 . '\(\(user_editcount >= 500\) AND \(user_registration <= \'[^\']+\'\)\)/',
690 "rc conditions: userExpLevel=unregistered;experienced"
694 public function testFilterUserExpLevel() {
696 $this->setMwGlobals( [
697 'wgLearnerEdits' => 10,
698 'wgLearnerMemberSince' => 4,
699 'wgExperiencedUserEdits' => 500,
700 'wgExperiencedUserMemberSince' => 30,
703 $this->createUsers( [
704 'Newcomer1' => [ 'edits' => 2, 'days' => 2 ],
705 'Newcomer2' => [ 'edits' => 12, 'days' => 3 ],
706 'Newcomer3' => [ 'edits' => 8, 'days' => 5 ],
707 'Learner1' => [ 'edits' => 15, 'days' => 10 ],
708 'Learner2' => [ 'edits' => 450, 'days' => 20 ],
709 'Learner3' => [ 'edits' => 460, 'days' => 33 ],
710 'Learner4' => [ 'edits' => 525, 'days' => 28 ],
711 'Experienced1' => [ 'edits' => 538, 'days' => 33 ],
715 $this->assertArrayEquals(
716 [ 'Newcomer1', 'Newcomer2', 'Newcomer3' ],
717 $this->fetchUsers( [ 'newcomer' ], $now )
720 // newcomers and learner
721 $this->assertArrayEquals(
723 'Newcomer1', 'Newcomer2', 'Newcomer3',
724 'Learner1', 'Learner2', 'Learner3', 'Learner4',
726 $this->fetchUsers( [ 'newcomer', 'learner' ], $now )
729 // newcomers and more learner
730 $this->assertArrayEquals(
732 'Newcomer1', 'Newcomer2', 'Newcomer3',
735 $this->fetchUsers( [ 'newcomer', 'experienced' ], $now )
739 $this->assertArrayEquals(
740 [ 'Learner1', 'Learner2', 'Learner3', 'Learner4' ],
741 $this->fetchUsers( [ 'learner' ], $now )
744 // more experienced only
745 $this->assertArrayEquals(
747 $this->fetchUsers( [ 'experienced' ], $now )
750 // learner and more experienced
751 $this->assertArrayEquals(
753 'Learner1', 'Learner2', 'Learner3', 'Learner4',
756 $this->fetchUsers( [ 'learner', 'experienced' ], $now )
760 private function createUsers( $specs, $now ) {
761 $dbw = wfGetDB( DB_MASTER
);
762 foreach ( $specs as $name => $spec ) {
766 'editcount' => $spec['edits'],
767 'registration' => $dbw->timestamp( $this->daysAgo( $spec['days'], $now ) ),
774 private function fetchUsers( $filters, $now ) {
783 call_user_func_array(
784 [ $this->changesListSpecialPage
, 'filterOnUserExperienceLevel' ],
786 get_class( $this->changesListSpecialPage
),
787 $this->changesListSpecialPage
->getContext(),
788 $this->changesListSpecialPage
->getDB(),
799 // @todo: This is not at all safe or sane. It just blindly assumes
800 // nothing in $conds depends on any other tables.
801 $result = wfGetDB( DB_MASTER
)->select(
804 array_filter( $conds ) +
[ 'user_email' => 'ut' ]
808 foreach ( $result as $row ) {
809 $usernames[] = $row->user_name
;
815 private function daysAgo( $days, $now ) {
816 $secondsPerDay = 86400;
817 return $now - $days * $secondsPerDay;
820 public function testGetStructuredFilterJsData() {
821 $this->changesListSpecialPage
->filterGroups
= [];
825 'name' => 'gub-group',
826 'title' => 'gub-group-title',
827 'class' => ChangesListBooleanFilterGroup
::class,
831 'label' => 'foo-label',
832 'description' => 'foo-description',
834 'showHide' => 'showhidefoo',
839 'label' => 'bar-label',
840 'description' => 'bar-description',
848 'name' => 'des-group',
849 'title' => 'des-group-title',
850 'class' => ChangesListStringOptionsFilterGroup
::class,
851 'isFullCoverage' => true,
855 'label' => 'grault-label',
856 'description' => 'grault-description',
860 'label' => 'garply-label',
861 'description' => 'garply-description',
864 'queryCallable' => function () {
866 'default' => ChangesListStringOptionsFilterGroup
::NONE
,
870 'name' => 'unstructured',
871 'class' => ChangesListBooleanFilterGroup
::class,
874 'name' => 'hidethud',
875 'showHide' => 'showhidethud',
881 'showHide' => 'showhidemos',
889 $this->changesListSpecialPage
->registerFiltersFromDefinitions( $definition );
891 $this->assertArrayEquals(
893 // Filters that only display in the unstructured UI are
894 // are not included, and neither are groups that would
895 // be empty due to the above.
898 'name' => 'gub-group',
899 'title' => 'gub-group-title',
900 'type' => ChangesListBooleanFilterGroup
::TYPE
,
905 'label' => 'bar-label',
906 'description' => 'bar-description',
912 'defaultHighlightColor' => null
916 'label' => 'foo-label',
917 'description' => 'foo-description',
923 'defaultHighlightColor' => null
926 'fullCoverage' => true,
931 'name' => 'des-group',
932 'title' => 'des-group-title',
933 'type' => ChangesListStringOptionsFilterGroup
::TYPE
,
935 'fullCoverage' => true,
939 'label' => 'grault-label',
940 'description' => 'grault-description',
945 'defaultHighlightColor' => null
949 'label' => 'garply-label',
950 'description' => 'garply-description',
955 'defaultHighlightColor' => null
960 'default' => ChangesListStringOptionsFilterGroup
::NONE
,
971 'grault-description',
973 'garply-description',
976 $this->changesListSpecialPage
->getStructuredFilterJsData(),
977 /** ordered= */ false,
982 public function provideParseParameters() {
984 [ 'hidebots', [ 'hidebots' => true ] ],
986 [ 'bots', [ 'hidebots' => false ] ],
988 [ 'hideminor', [ 'hideminor' => true ] ],
990 [ 'minor', [ 'hideminor' => false ] ],
992 [ 'hidemajor', [ 'hidemajor' => true ] ],
994 [ 'hideliu', [ 'hideliu' => true ] ],
996 [ 'hidepatrolled', [ 'hidepatrolled' => true ] ],
998 [ 'hideunpatrolled', [ 'hideunpatrolled' => true ] ],
1000 [ 'hideanons', [ 'hideanons' => true ] ],
1002 [ 'hidemyself', [ 'hidemyself' => true ] ],
1004 [ 'hidebyothers', [ 'hidebyothers' => true ] ],
1006 [ 'hidehumans', [ 'hidehumans' => true ] ],
1008 [ 'hidepageedits', [ 'hidepageedits' => true ] ],
1010 [ 'pagedits', [ 'hidepageedits' => false ] ],
1012 [ 'hidenewpages', [ 'hidenewpages' => true ] ],
1014 [ 'hidecategorization', [ 'hidecategorization' => true ] ],
1016 [ 'hidelog', [ 'hidelog' => true ] ],
1019 'userExpLevel=learner;experienced',
1021 'userExpLevel' => 'learner;experienced'
1025 // A few random combos
1027 'bots,hideliu,hidemyself',
1029 'hidebots' => false,
1031 'hidemyself' => true,
1036 'minor,hideanons,categorization',
1038 'hideminor' => false,
1039 'hideanons' => true,
1040 'hidecategorization' => false,
1045 'hidehumans,bots,hidecategorization',
1047 'hidehumans' => true,
1048 'hidebots' => false,
1049 'hidecategorization' => true,
1054 'hidemyself,userExpLevel=newcomer;learner,hideminor',
1056 'hidemyself' => true,
1057 'hideminor' => true,
1058 'userExpLevel' => 'newcomer;learner',
1064 public function provideGetFilterConflicts() {
1068 "expectedConflicts" => false,
1073 "userExpLevel" => "newcomer",
1075 "expectedConflicts" => false,
1079 "hideanons" => true,
1080 "userExpLevel" => "learner",
1082 "expectedConflicts" => false,
1086 "hidemajor" => true,
1087 "hidenewpages" => true,
1088 "hidepageedits" => true,
1089 "hidecategorization" => false,
1091 "hideWikidata" => true,
1093 "expectedConflicts" => true,
1097 "hidemajor" => true,
1098 "hidenewpages" => false,
1099 "hidepageedits" => true,
1100 "hidecategorization" => false,
1102 "hideWikidata" => true,
1104 "expectedConflicts" => true,
1108 "hidemajor" => true,
1109 "hidenewpages" => false,
1110 "hidepageedits" => false,
1111 "hidecategorization" => true,
1113 "hideWikidata" => true,
1115 "expectedConflicts" => false,
1119 "hideminor" => true,
1120 "hidenewpages" => true,
1121 "hidepageedits" => true,
1122 "hidecategorization" => false,
1124 "hideWikidata" => true,
1126 "expectedConflicts" => false,
1132 * @dataProvider provideGetFilterConflicts
1134 public function testGetFilterConflicts( $parameters, $expectedConflicts ) {
1135 $context = new RequestContext
;
1136 $context->setRequest( new FauxRequest( $parameters ) );
1137 $this->changesListSpecialPage
->setContext( $context );
1139 $this->assertEquals(
1141 $this->changesListSpecialPage
->areFiltersInConflict()
1145 public function validateOptionsProvider() {
1148 [ 'hideanons' => 1, 'hideliu' => 1, 'hidebots' => 1 ],
1150 [ 'userExpLevel' => 'unregistered', 'hidebots' => 1, ],
1154 [ 'hideanons' => 1, 'hideliu' => 1, 'hidebots' => 0 ],
1156 [ 'hidebots' => 0, 'hidehumans' => 1 ],
1160 [ 'hideanons' => 1 ],
1162 [ 'userExpLevel' => 'registered' ],
1168 [ 'userExpLevel' => 'unregistered' ],
1172 [ 'hideanons' => 1, 'hidebots' => 1 ],
1174 [ 'userExpLevel' => 'registered', 'hidebots' => 1 ],
1178 [ 'hideliu' => 1, 'hidebots' => 0 ],
1180 [ 'userExpLevel' => 'unregistered', 'hidebots' => 0 ],
1184 [ 'hidemyself' => 1, 'hidebyothers' => 1 ],
1190 [ 'hidebots' => 1, 'hidehumans' => 1 ],
1196 [ 'hidepatrolled' => 1, 'hideunpatrolled' => 1 ],
1202 [ 'hideminor' => 1, 'hidemajor' => 1 ],
1209 [ 'hidepageedits' => 1, 'hidenewpages' => 1, 'hidecategorization' => 1, 'hidelog' => 1, ],