if ( $config->get( 'RCWatchCategoryMembership' ) ) {
$opts->add( 'hidecategorization', false );
}
+ $opts->add( 'hidepageedits', false );
+ $opts->add( 'hidenewpages', false );
+ $opts->add( 'hidelog', false );
$opts->add( 'namespace', '', FormOptions::INTNULL );
$opts->add( 'invert', false );
) {
$conds[] = 'rc_type != ' . $dbr->addQuotes( RC_CATEGORIZE );
}
+ if ( $opts['hidepageedits'] ) {
+ $conds[] = 'rc_type != ' . $dbr->addQuotes( RC_EDIT );
+ }
+ if ( $opts['hidenewpages'] ) {
+ $conds[] = 'rc_type != ' . $dbr->addQuotes( RC_NEW );
+ }
+ if ( $opts['hidelog'] ) {
+ $conds[] = 'rc_type != ' . $dbr->addQuotes( RC_LOG );
+ }
// Namespace filtering
if ( $opts['namespace'] !== '' ) {
$user
);
}
+
+ public function testRcHidepageedits() {
+ $this->assertConditions(
+ [ # expected
+ 'rc_bot' => 0,
+ "rc_type != '6'",
+ "rc_type != '0'",
+ ],
+ [
+ 'hidepageedits' => 1,
+ ],
+ "rc conditions: hidepageedits=1"
+ );
+ }
+
+ public function testRcHidenewpages() {
+ $this->assertConditions(
+ [ # expected
+ 'rc_bot' => 0,
+ "rc_type != '6'",
+ "rc_type != '1'",
+ ],
+ [
+ 'hidenewpages' => 1,
+ ],
+ "rc conditions: hidenewpages=1"
+ );
+ }
+
+ public function testRcHidelog() {
+ $this->assertConditions(
+ [ # expected
+ 'rc_bot' => 0,
+ "rc_type != '6'",
+ "rc_type != '3'",
+ ],
+ [
+ 'hidelog' => 1,
+ ],
+ "rc conditions: hidelog=1"
+ );
+ }
}