X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Fapi%2FApiQueryBlocksTest.php;h=6e0084276fcd19c0462e586ac5db2ee791a2c03e;hb=57609f4ded4c9ac529d7fbfd30d3585372fcc0ce;hp=dc7d450dba8c2339a790305e78de47c5c7388dad;hpb=f57c8f9da04b42361beb1d396f5d0f614a4895bb;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/api/ApiQueryBlocksTest.php b/tests/phpunit/includes/api/ApiQueryBlocksTest.php index dc7d450dba..6e0084276f 100644 --- a/tests/phpunit/includes/api/ApiQueryBlocksTest.php +++ b/tests/phpunit/includes/api/ApiQueryBlocksTest.php @@ -1,6 +1,7 @@ PageRestriction::TYPE_ID, 'ir_value' => $pageId, ] ); + // Page that has been deleted. $this->db->insert( 'ipblocks_restrictions', [ 'ir_ipb_id' => $block->getId(), - 'ir_type' => 2, - 'ir_value' => 3, + 'ir_type' => PageRestriction::TYPE_ID, + 'ir_value' => 999999, + ] ); + $this->db->insert( 'ipblocks_restrictions', [ + 'ir_ipb_id' => $block->getId(), + '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 +161,9 @@ class ApiQueryBlocksTest extends ApiTestCase { 'title' => $title, ], ], + 'namespaces' => [ + NS_USER_TALK, + ], ], ] ); $this->assertArraySubset( $restrictionsSubset, $data['query']['blocks'][0] );