Skip to content

Commit

Permalink
ReferencedNameHelper: More tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kukulich committed May 13, 2021
1 parent 4814173 commit 4a8efc9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/Helpers/ReferencedNameHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public function testGetAllReferencedNames(): void
['str_pad', true, false],
['STR_PAD_RIGHT', false, true],
['EnumType', false, false],
['UrlGeneratorInterface', false, false],
];

$names = ReferencedNameHelper::getAllReferencedNames($phpcsFile, 0);
Expand Down
12 changes: 12 additions & 0 deletions tests/Helpers/data/lotsOfReferencedNames.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use DateTime;
use DateTimeImmutable;
use Doctrine\ORM\Mapping as ORM;
use UrlGeneratorInterface;
use UsedNamespace\UsedNameFooBar as UsedNameFooBarBaz;
use function DI\string;
use function doSomething;
Expand Down Expand Up @@ -164,3 +165,14 @@ public function call2(bool|UnionType6 $union)
}

echo str_pad('123', 1, pad_type: STR_PAD_RIGHT, enum_type: EnumType::VALUE());


class SomeController
{
public function generateRoute($router): string
{
return $router->generate('login_password_set', [
'resetCode' => 'somecode',
], referenceType: UrlGeneratorInterface::RELATIVE_PATH);
}
}

0 comments on commit 4a8efc9

Please sign in to comment.