Skip to content

Commit 5f1cc1c

Browse files
authored
[CLEANUP] Combine some test methods in SelectorTest (#1490)
Multiple data providers can be specified for a test method which does exactly the same thing as another, to avoid having the 'another'.
1 parent 46147e2 commit 5f1cc1c

1 file changed

Lines changed: 2 additions & 27 deletions

File tree

tests/Unit/Property/SelectorTest.php

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ public static function provideSelectorsAndSpecificities(): array
8484
* @param non-empty-string $selector
8585
*
8686
* @dataProvider provideSelectorsAndSpecificities
87+
* @dataProvider provideSelectorsWithEscapedQuotes
8788
*/
8889
public function parsesValidSelector(string $selector): void
8990
{
@@ -295,6 +296,7 @@ public function getSpecificityReturnsSpecificityOfSelectorLastProvidedViaSetSele
295296
* @test
296297
*
297298
* @dataProvider provideSelectorsAndSpecificities
299+
* @dataProvider provideSelectorsWithEscapedQuotes
298300
*/
299301
public function isValidForValidSelectorReturnsTrue(string $selector): void
300302
{
@@ -392,33 +394,6 @@ public static function provideSelectorsWithEscapedQuotes(): array
392394
];
393395
}
394396

395-
/**
396-
* @test
397-
*
398-
* @param non-empty-string $selector
399-
*
400-
* @dataProvider provideSelectorsWithEscapedQuotes
401-
*/
402-
public function parsesSelectorsWithEscapedQuotes(string $selector): void
403-
{
404-
$result = Selector::parse(new ParserState($selector, Settings::create()));
405-
406-
self::assertInstanceOf(Selector::class, $result);
407-
self::assertSame($selector, $result->getSelector());
408-
}
409-
410-
/**
411-
* @test
412-
*
413-
* @param non-empty-string $selector
414-
*
415-
* @dataProvider provideSelectorsWithEscapedQuotes
416-
*/
417-
public function isValidForSelectorsWithEscapedQuotesReturnsTrue(string $selector): void
418-
{
419-
self::assertTrue(Selector::isValid($selector));
420-
}
421-
422397
/**
423398
* @test
424399
*/

0 commit comments

Comments
 (0)