From: David Barratt Date: Thu, 15 Nov 2018 22:32:09 +0000 (-0500) Subject: Add tests to ensure that NamespaceRestrictions are returned from Block APIs. X-Git-Tag: 1.34.0-rc.0~3015^2 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/supprimer.php?a=commitdiff_plain;h=8631ea7bf6456ec8b4eb81cdbcb8761d427a34f9;p=lhc%2Fweb%2Fwiklou.git Add tests to ensure that NamespaceRestrictions are returned from Block APIs. Bug: T204989 Change-Id: Ibe44da41e9efa6688615dc9b0712f9713d4e8158 --- diff --git a/tests/phpunit/includes/api/ApiQueryBlocksTest.php b/tests/phpunit/includes/api/ApiQueryBlocksTest.php index dc7d450dba..03198a8781 100644 --- a/tests/phpunit/includes/api/ApiQueryBlocksTest.php +++ b/tests/phpunit/includes/api/ApiQueryBlocksTest.php @@ -1,6 +1,7 @@ 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] );