Fix typo in tests/phpunit/includes/Revision/MainSlotRoleHandlerTest.php
[lhc/web/wiklou.git] / tests / phpunit / includes / api / ApiQueryBlocksTest.php
index dc7d450..03198a8 100644 (file)
@@ -1,6 +1,7 @@
 <?php
 
 use MediaWiki\Block\Restriction\PageRestriction;
+use MediaWiki\Block\Restriction\NamespaceRestriction;
 
 /**
  * @group API
@@ -113,8 +114,13 @@ class ApiQueryBlocksTest extends ApiTestCase {
                ] );
                $this->db->insert( 'ipblocks_restrictions', [
                        'ir_ipb_id' => $block->getId(),
-                       'ir_type' => 2,
-                       'ir_value' => 3,
+                       'ir_type' => NamespaceRestriction::TYPE_ID,
+                       'ir_value' => NS_USER_TALK,
+               ] );
+               $this->db->insert( 'ipblocks_restrictions', [
+                       'ir_ipb_id' => $block->getId(),
+                       'ir_type' => 3,
+                       'ir_value' => 4,
                ] );
 
                // Test without requesting restrictions.
@@ -149,6 +155,9 @@ class ApiQueryBlocksTest extends ApiTestCase {
                                                'title' => $title,
                                        ],
                                ],
+                               'namespaces' => [
+                                       NS_USER_TALK,
+                               ],
                        ],
                ] );
                $this->assertArraySubset( $restrictionsSubset, $data['query']['blocks'][0] );