17 'ipblocks_restrictions',
25 $this->assertEquals( [
'batchcomplete' =>
true,
'query' => [
'blocks' => [] ] ],
$data );
33 'address' => $badActor->getName(),
34 'user' => $badActor->getId(),
35 'by' => $sysop->getId(),
36 'expiry' =>
'infinity',
45 $this->arrayHasKey(
'query',
$data );
46 $this->arrayHasKey(
'blocks',
$data[
'query'] );
47 $this->assertCount( 1,
$data[
'query'][
'blocks'] );
49 'id' => $block->getId(),
50 'user' => $badActor->getName(),
51 'expiry' => $block->getExpiry(),
53 $this->assertArraySubset( $subset,
$data[
'query'][
'blocks'][0] );
61 'address' => $badActor->getName(),
62 'user' => $badActor->getId(),
63 'by' => $sysop->getId(),
64 'ipb_expiry' =>
'infinity',
74 $this->arrayHasKey(
'query',
$data );
75 $this->arrayHasKey(
'blocks',
$data[
'query'] );
76 $this->assertCount( 1,
$data[
'query'][
'blocks'] );
78 'id' => $block->getId(),
79 'user' => $badActor->getName(),
80 'expiry' => $block->getExpiry(),
81 'partial' => !$block->isSitewide(),
83 $this->assertArraySubset( $subset,
$data[
'query'][
'blocks'][0] );
91 'address' => $badActor->getName(),
92 'user' => $badActor->getId(),
93 'by' => $sysop->getId(),
94 'expiry' =>
'infinity',
101 'id' => $block->getId(),
102 'user' => $badActor->getName(),
103 'expiry' => $block->getExpiry(),
108 $pageId = $pageData[
'id'];
110 $this->db->insert(
'ipblocks_restrictions', [
111 'ir_ipb_id' => $block->getId(),
112 'ir_type' => PageRestriction::TYPE_ID,
113 'ir_value' => $pageId,
116 $this->db->insert(
'ipblocks_restrictions', [
117 'ir_ipb_id' => $block->getId(),
118 'ir_type' => PageRestriction::TYPE_ID,
119 'ir_value' => 999999,
121 $this->db->insert(
'ipblocks_restrictions', [
122 'ir_ipb_id' => $block->getId(),
123 'ir_type' => NamespaceRestriction::TYPE_ID,
126 $this->db->insert(
'ipblocks_restrictions', [
127 'ir_ipb_id' => $block->getId(),
137 $this->arrayHasKey(
'query',
$data );
138 $this->arrayHasKey(
'blocks',
$data[
'query'] );
139 $this->assertCount( 1,
$data[
'query'][
'blocks'] );
140 $flagSubset = array_merge( $subset, [
141 'partial' => !$block->isSitewide(),
143 $this->assertArraySubset( $flagSubset,
$data[
'query'][
'blocks'][0] );
144 $this->assertArrayNotHasKey(
'restrictions',
$data[
'query'][
'blocks'][0] );
150 'bkprop' =>
'id|user|expiry|restrictions'
152 $this->arrayHasKey(
'query',
$data );
153 $this->arrayHasKey(
'blocks',
$data[
'query'] );
154 $this->assertCount( 1,
$data[
'query'][
'blocks'] );
155 $restrictionsSubset = array_merge( $subset, [
169 $this->assertArraySubset( $restrictionsSubset,
$data[
'query'][
'blocks'][0] );
170 $this->assertArrayNotHasKey(
'partial',
$data[
'query'][
'blocks'][0] );