Merge "DumpUploads: output local path instead of mwstore path"
[lhc/web/wiklou.git] / tests / phpunit / includes / specials / SpecialRecentchangesTest.php
index c3d75aa..cc16e5f 100644 (file)
  */
 class SpecialRecentchangesTest extends MediaWikiTestCase {
 
+       protected function setUp() {
+               parent::setUp();
+               $this->setMwGlobals( 'wgRCWatchCategoryMembership', true );
+       }
+
        /**
         * @var SpecialRecentChanges
         */
@@ -26,7 +31,7 @@ class SpecialRecentchangesTest extends MediaWikiTestCase {
                $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(
@@ -48,27 +53,29 @@ class SpecialRecentchangesTest extends MediaWikiTestCase {
 
        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"
                );
        }
@@ -79,14 +86,15 @@ class SpecialRecentchangesTest extends MediaWikiTestCase {
         */
        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"
                );
        }
@@ -97,15 +105,16 @@ class SpecialRecentchangesTest extends MediaWikiTestCase {
         */
        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"
                );
        }
@@ -115,9 +124,9 @@ class SpecialRecentchangesTest extends MediaWikiTestCase {
         * 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 ],
+               ];
        }
 }