|
11 | 11 |
|
12 | 12 | namespace Symfony\Component\Finder\Tests; |
13 | 13 |
|
| 14 | +use PHPUnit\Framework\Attributes\DataProvider; |
| 15 | +use PHPUnit\Framework\ExpectationFailedException; |
14 | 16 | use Symfony\Component\Finder\Exception\DirectoryNotFoundException; |
15 | 17 | use Symfony\Component\Finder\Finder; |
16 | 18 |
|
@@ -297,9 +299,7 @@ public function testNotNameWithArrayParam() |
297 | 299 | ]), $finder->in(self::$tmpDir)->getIterator()); |
298 | 300 | } |
299 | 301 |
|
300 | | - /** |
301 | | - * @dataProvider getRegexNameTestData |
302 | | - */ |
| 302 | + #[DataProvider('getRegexNameTestData')] |
303 | 303 | public function testRegexName($regex) |
304 | 304 | { |
305 | 305 | $finder = $this->buildFinder(); |
@@ -1367,9 +1367,7 @@ public function testNoResults() |
1367 | 1367 | $this->assertFalse($finder->hasResults()); |
1368 | 1368 | } |
1369 | 1369 |
|
1370 | | - /** |
1371 | | - * @dataProvider getContainsTestData |
1372 | | - */ |
| 1370 | + #[DataProvider('getContainsTestData')] |
1373 | 1371 | public function testContains($matchPatterns, $noMatchPatterns, $expected) |
1374 | 1372 | { |
1375 | 1373 | $finder = $this->buildFinder(); |
@@ -1498,9 +1496,7 @@ public static function getRegexNameTestData() |
1498 | 1496 | ]; |
1499 | 1497 | } |
1500 | 1498 |
|
1501 | | - /** |
1502 | | - * @dataProvider getTestPathData |
1503 | | - */ |
| 1499 | + #[DataProvider('getTestPathData')] |
1504 | 1500 | public function testPath($matchPatterns, $noMatchPatterns, array $expected) |
1505 | 1501 | { |
1506 | 1502 | $finder = $this->buildFinder(); |
@@ -1602,7 +1598,7 @@ public function testAccessDeniedException() |
1602 | 1598 | $this->fail('Finder should throw an exception when opening a non-readable directory.'); |
1603 | 1599 | } catch (\Exception $e) { |
1604 | 1600 | $expectedExceptionClass = 'Symfony\\Component\\Finder\\Exception\\AccessDeniedException'; |
1605 | | - if ($e instanceof \PHPUnit\Framework\ExpectationFailedException) { |
| 1601 | + if ($e instanceof ExpectationFailedException) { |
1606 | 1602 | $this->fail(\sprintf("Expected exception:\n%s\nGot:\n%s\nWith comparison failure:\n%s", $expectedExceptionClass, 'PHPUnit\Framework\ExpectationFailedException', $e->getComparisonFailure()->getExpectedAsString())); |
1607 | 1603 | } |
1608 | 1604 |
|
|
0 commit comments