*/
class SpecialRecentchangesTest extends MediaWikiTestCase {
+ protected function setUp() {
+ parent::setUp();
+ $this->setMwGlobals( 'wgRCWatchCategoryMembership', true );
+ }
+
/**
* @var SpecialRecentChanges
*/
$this->rc->setContext( $context );
$formOptions = $this->rc->setup( null );
- # Filter out rc_timestamp conditions which depends on the test runtime
+ # Filter out rc_timestamp conditions which depends on the test runtime
# This condition is not needed as of march 2, 2011 -- hashar
# @todo FIXME: Find a way to generate the correct rc_timestamp
$queryConditions = array_filter(
public function testRcNsFilter() {
$this->assertConditions(
- array( # expected
+ [ # expected
'rc_bot' => 0,
- 0 => "rc_namespace = '0'",
- ),
- array(
+ 0 => "rc_type != '6'",
+ 1 => "rc_namespace = '0'",
+ ],
+ [
'namespace' => NS_MAIN,
- ),
+ ],
"rc conditions with no options (aka default setting)"
);
}
public function testRcNsFilterInversion() {
$this->assertConditions(
- array( # expected
+ [ # expected
'rc_bot' => 0,
- 0 => sprintf( "rc_namespace != '%s'", NS_MAIN ),
- ),
- array(
+ 0 => "rc_type != '6'",
+ 1 => sprintf( "rc_namespace != '%s'", NS_MAIN ),
+ ],
+ [
'namespace' => NS_MAIN,
'invert' => 1,
- ),
+ ],
"rc conditions with namespace inverted"
);
}
*/
public function testRcNsFilterAssociation( $ns1, $ns2 ) {
$this->assertConditions(
- array( # expected
+ [ # expected
'rc_bot' => 0,
- 0 => sprintf( "(rc_namespace = '%s' OR rc_namespace = '%s')", $ns1, $ns2 ),
- ),
- array(
+ 0 => "rc_type != '6'",
+ 1 => sprintf( "(rc_namespace = '%s' OR rc_namespace = '%s')", $ns1, $ns2 ),
+ ],
+ [
'namespace' => $ns1,
'associated' => 1,
- ),
+ ],
"rc conditions with namespace inverted"
);
}
*/
public function testRcNsFilterAssociationWithInversion( $ns1, $ns2 ) {
$this->assertConditions(
- array( # expected
+ [ # expected
'rc_bot' => 0,
- 0 => sprintf( "(rc_namespace != '%s' AND rc_namespace != '%s')", $ns1, $ns2 ),
- ),
- array(
+ 0 => "rc_type != '6'",
+ 1 => sprintf( "(rc_namespace != '%s' AND rc_namespace != '%s')", $ns1, $ns2 ),
+ ],
+ [
'namespace' => $ns1,
'associated' => 1,
'invert' => 1,
- ),
+ ],
"rc conditions with namespace inverted"
);
}
* namespaces association filtering.
*/
public static function provideNamespacesAssociations() {
- return array( # (NS => Associated_NS)
- array( NS_MAIN, NS_TALK ),
- array( NS_TALK, NS_MAIN ),
- );
+ return [ # (NS => Associated_NS)
+ [ NS_MAIN, NS_TALK ],
+ [ NS_TALK, NS_MAIN ],
+ ];
}
}