2020
2121class TagFilterTest extends TestCase
2222{
23- public function testFilterFeature ()
23+ public function testFilterFeature (): void
2424 {
2525 $ feature = new FeatureNode (null , null , ['wip ' ], null , [], null , null , null , 1 );
2626 $ filter = new TagFilter ('@wip ' );
@@ -46,7 +46,7 @@ public function testFilterFeature()
4646 $ this ->assertSame ([$ matchedScenario ], $ filteredFeature ->getScenarios ());
4747 }
4848
49- public function testIsFeatureMatchFilter ()
49+ public function testIsFeatureMatchFilter (): void
5050 {
5151 $ feature = new FeatureNode (null , null , [], null , [], null , null , null , 1 );
5252
@@ -95,7 +95,7 @@ public function testIsFeatureMatchFilter()
9595 $ this ->assertTrue ($ filter ->isFeatureMatch ($ feature ));
9696 }
9797
98- public function testIsScenarioMatchFilter ()
98+ public function testIsScenarioMatchFilter (): void
9999 {
100100 $ feature = new FeatureNode (null , null , ['feature-tag ' ], null , [], null , null , null , 1 );
101101 $ scenario = new ScenarioNode (null , [], [], null , 2 );
@@ -189,7 +189,7 @@ public function testIsScenarioMatchFilter()
189189 $ this ->assertFalse ($ tagFilter ->isScenarioMatch ($ feature , $ scenario ), 'Tags from different examples tables ' );
190190 }
191191
192- public function testFilterFeatureWithTaggedExamples ()
192+ public function testFilterFeatureWithTaggedExamples (): void
193193 {
194194 $ exampleTableNode1 = new ExampleTableNode ([], null , ['etag1 ' , 'etag2 ' ]);
195195 $ exampleTableNode2 = new ExampleTableNode ([], null , ['etag2 ' , 'etag3 ' ]);
@@ -207,13 +207,13 @@ public function testFilterFeatureWithTaggedExamples()
207207 $ tagFilter = new TagFilter ('@etag1 ' );
208208 $ matched = $ tagFilter ->filterFeature ($ feature );
209209 $ scenarioInterfaces = $ matched ->getScenarios ();
210- /* @noinspection PhpUndefinedMethodInspection */
210+ $ this -> assertInstanceOf (OutlineNode::class, $ scenarioInterfaces [ 0 ]);
211211 $ this ->assertEquals ([$ exampleTableNode1 ], $ scenarioInterfaces [0 ]->getExampleTables ());
212212
213213 $ tagFilter = new TagFilter ('~@etag3 ' );
214214 $ matched = $ tagFilter ->filterFeature ($ feature );
215215 $ scenarioInterfaces = $ matched ->getScenarios ();
216- /* @noinspection PhpUndefinedMethodInspection */
216+ $ this -> assertInstanceOf (OutlineNode::class, $ scenarioInterfaces [ 0 ]);
217217 $ this ->assertEquals ([$ exampleTableNode1 ], $ scenarioInterfaces [0 ]->getExampleTables ());
218218
219219 $ tagFilter = new TagFilter ('@wip ' );
@@ -224,13 +224,13 @@ public function testFilterFeatureWithTaggedExamples()
224224 $ tagFilter = new TagFilter ('@wip&&@etag3 ' );
225225 $ matched = $ tagFilter ->filterFeature ($ feature );
226226 $ scenarioInterfaces = $ matched ->getScenarios ();
227- /* @noinspection PhpUndefinedMethodInspection */
227+ $ this -> assertInstanceOf (OutlineNode::class, $ scenarioInterfaces [ 0 ]);
228228 $ this ->assertEquals ([$ exampleTableNode2 ], $ scenarioInterfaces [0 ]->getExampleTables ());
229229
230230 $ tagFilter = new TagFilter ('@feature-tag&&@etag1&&@wip ' );
231231 $ matched = $ tagFilter ->filterFeature ($ feature );
232232 $ scenarioInterfaces = $ matched ->getScenarios ();
233- /* @noinspection PhpUndefinedMethodInspection */
233+ $ this -> assertInstanceOf (OutlineNode::class, $ scenarioInterfaces [ 0 ]);
234234 $ this ->assertEquals ([$ exampleTableNode1 ], $ scenarioInterfaces [0 ]->getExampleTables ());
235235
236236 $ tagFilter = new TagFilter ('@feature-tag&&~@etag11111&&@wip ' );
@@ -241,7 +241,7 @@ public function testFilterFeatureWithTaggedExamples()
241241 $ tagFilter = new TagFilter ('@feature-tag&&~@etag1&&@wip ' );
242242 $ matched = $ tagFilter ->filterFeature ($ feature );
243243 $ scenarioInterfaces = $ matched ->getScenarios ();
244- /* @noinspection PhpUndefinedMethodInspection */
244+ $ this -> assertInstanceOf (OutlineNode::class, $ scenarioInterfaces [ 0 ]);
245245 $ this ->assertEquals ([$ exampleTableNode2 ], $ scenarioInterfaces [0 ]->getExampleTables ());
246246
247247 $ tagFilter = new TagFilter ('@feature-tag&&@etag2 ' );
@@ -272,13 +272,13 @@ public function testFilterFeatureWithTaggedExamples()
272272 $ matched = $ tagFilter ->filterFeature ($ feature );
273273 $ scenarioInterfaces = $ matched ->getScenarios ();
274274 $ this ->assertCount (2 , $ scenarioInterfaces );
275- /* @noinspection PhpUndefinedMethodInspection */
275+ $ this -> assertInstanceOf (OutlineNode::class, $ scenarioInterfaces [ 0 ]);
276276 $ this ->assertEquals ([$ exampleTableNode2 ], $ scenarioInterfaces [0 ]->getExampleTables ());
277- /* @noinspection PhpUndefinedMethodInspection */
277+ $ this -> assertInstanceOf (OutlineNode::class, $ scenarioInterfaces [ 1 ]);
278278 $ this ->assertEquals ([$ exampleTableNode3 ], $ scenarioInterfaces [1 ]->getExampleTables ());
279279 }
280280
281- public function testFilterWithWhitespaceIsDeprecated ()
281+ public function testFilterWithWhitespaceIsDeprecated (): void
282282 {
283283 $ this ->expectDeprecationError ();
284284
@@ -291,7 +291,7 @@ public function testFilterWithWhitespaceIsDeprecated()
291291 $ this ->assertEquals ([$ scenario ], $ scenarios );
292292 }
293293
294- public function testTagFilterThatIsAllWhitespaceIsIgnored ()
294+ public function testTagFilterThatIsAllWhitespaceIsIgnored (): void
295295 {
296296 $ feature = new FeatureNode (null , null , [], null , [], null , null , null , 1 );
297297 $ tagFilter = new TagFilter ('' );
@@ -300,7 +300,7 @@ public function testTagFilterThatIsAllWhitespaceIsIgnored()
300300 $ this ->assertTrue ($ result );
301301 }
302302
303- private function expectDeprecationError ()
303+ private function expectDeprecationError (): void
304304 {
305305 set_error_handler (
306306 static function ($ errno , $ errstr ) {
@@ -309,6 +309,6 @@ static function ($errno, $errstr) {
309309 },
310310 E_ALL
311311 );
312- $ this ->expectException (' Exception ' );
312+ $ this ->expectException (Exception::class );
313313 }
314314}
0 commit comments