2121use Brainbits \Blocking \Validator \ValidatorInterface ;
2222use PHPUnit \Framework \TestCase ;
2323use Prophecy \Argument ;
24+ use Prophecy \PhpUnit \ProphecyTrait ;
2425use Prophecy \Prophecy \ObjectProphecy ;
2526
2627/**
2728 * Blocker test
2829 */
2930class BlockerTest extends TestCase
3031{
32+ use ProphecyTrait;
33+
3134 /**
3235 * @var BlockInterface|ObjectProphecy
3336 */
@@ -45,7 +48,7 @@ class BlockerTest extends TestCase
4548
4649 private $ owner ;
4750
48- protected function setUp ()
51+ protected function setUp (): void
4952 {
5053 $ this ->owner = new Owner ('bar ' );
5154
@@ -62,7 +65,7 @@ protected function setUp()
6265 ->willReturn (new Owner ('baz ' ));
6366 }
6467
65- public function testBlockReturnsBlockOnNonexistingBlock ()
68+ public function testBlockReturnsBlockOnNonexistingBlock (): void
6669 {
6770 $ storage = $ this ->createNonexistingStorage ();
6871 $ storage ->write (Argument::type (BlockInterface::class))
@@ -78,7 +81,7 @@ public function testBlockReturnsBlockOnNonexistingBlock()
7881 $ this ->assertInstanceOf (BlockInterface::class, $ result );
7982 }
8083
81- public function testBlockReturnsBlockOnExistingAndInvalidBlock ()
84+ public function testBlockReturnsBlockOnExistingAndInvalidBlock (): void
8285 {
8386 $ storage = $ this ->createExistingStorage ();
8487 $ storage ->remove (Argument::type (BlockInterface::class))
@@ -96,7 +99,7 @@ public function testBlockReturnsBlockOnExistingAndInvalidBlock()
9699 $ this ->assertInstanceOf (BlockInterface::class, $ result );
97100 }
98101
99- public function testBlockThrowsExceptionOnExistingAndValidAndNonOwnerBlock ()
102+ public function testBlockThrowsExceptionOnExistingAndValidAndNonOwnerBlock (): void
100103 {
101104 $ this ->expectException (BlockFailedException::class);
102105
@@ -117,7 +120,7 @@ public function testBlockThrowsExceptionOnExistingAndValidAndNonOwnerBlock()
117120 $ this ->assertNull ($ result );
118121 }
119122
120- public function testBlockUpdatesBlockOnExistingAndValidAndOwnedBlock ()
123+ public function testBlockUpdatesBlockOnExistingAndValidAndOwnedBlock (): void
121124 {
122125 $ storage = $ this ->createExistingStorage ();
123126 $ storage ->touch ($ this ->block )
@@ -136,7 +139,7 @@ public function testBlockUpdatesBlockOnExistingAndValidAndOwnedBlock()
136139 $ this ->assertInstanceOf (BlockInterface::class, $ result );
137140 }
138141
139- public function testUnblockReturnsNullOnExistingAndInvalidBlock ()
142+ public function testUnblockReturnsNullOnExistingAndInvalidBlock (): void
140143 {
141144 $ storage = $ this ->createExistingStorage ();
142145 $ storage ->remove (Argument::type (BlockInterface::class))
@@ -152,7 +155,7 @@ public function testUnblockReturnsNullOnExistingAndInvalidBlock()
152155 $ this ->assertNull ($ result );
153156 }
154157
155- public function testUnblockReturnsBlockOnExistingAndValidBlock ()
158+ public function testUnblockReturnsBlockOnExistingAndValidBlock (): void
156159 {
157160 $ storage = $ this ->createExistingStorage ();
158161 $ storage ->remove (Argument::type (BlockInterface::class))
@@ -168,7 +171,7 @@ public function testUnblockReturnsBlockOnExistingAndValidBlock()
168171 $ this ->assertSame ($ this ->block ->reveal (), $ result );
169172 }
170173
171- public function testUnblockReturnsNullOnNonexistingBlock ()
174+ public function testUnblockReturnsNullOnNonexistingBlock (): void
172175 {
173176 $ storage = $ this ->createNonexistingStorage ();
174177 $ storage ->remove ()
@@ -184,7 +187,7 @@ public function testUnblockReturnsNullOnNonexistingBlock()
184187 $ this ->assertNull ($ result );
185188 }
186189
187- public function testIsBlockedReturnsFalseOnExistingAndInvalidBlock ()
190+ public function testIsBlockedReturnsFalseOnExistingAndInvalidBlock (): void
188191 {
189192 $ storage = $ this ->createExistingStorage ();
190193 $ storage ->remove (Argument::type (BlockInterface::class))
@@ -196,7 +199,7 @@ public function testIsBlockedReturnsFalseOnExistingAndInvalidBlock()
196199 $ this ->assertFalse ($ result );
197200 }
198201
199- public function testIsBlockedReturnsTrueOnExistingAndValidBlock ()
202+ public function testIsBlockedReturnsTrueOnExistingAndValidBlock (): void
200203 {
201204 $ blocker = new Blocker (
202205 $ this ->createExistingStorage ()->reveal (),
@@ -208,7 +211,7 @@ public function testIsBlockedReturnsTrueOnExistingAndValidBlock()
208211 $ this ->assertTrue ($ result );
209212 }
210213
211- public function testIsBlockedReturnsFalseOnNonexistingBlock ()
214+ public function testIsBlockedReturnsFalseOnNonexistingBlock (): void
212215 {
213216 $ blocker = new Blocker (
214217 $ this ->createNonexistingStorage ()->reveal (),
@@ -220,7 +223,7 @@ public function testIsBlockedReturnsFalseOnNonexistingBlock()
220223 $ this ->assertFalse ($ result );
221224 }
222225
223- public function testGetBlockReturnsBlockOnExistingBlock ()
226+ public function testGetBlockReturnsBlockOnExistingBlock (): void
224227 {
225228 $ blocker = new Blocker (
226229 $ this ->createExistingStorage ()->reveal (),
0 commit comments