File tree Expand file tree Collapse file tree 5 files changed +48
-0
lines changed
Expand file tree Collapse file tree 5 files changed +48
-0
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,15 @@ public function testClassToFile()
3333 ]), $ candidates );
3434 }
3535
36+ public function testClassToFileDeeper ()
37+ {
38+ $ candidates = $ this ->classToFile ->classToFileCandidates (ClassName::fromString ('Acme \\NamespaceHere \\Hallo ' ));
39+
40+ $ this ->assertEquals (FilePathCandidates::fromFilePaths ([
41+ FilePath::fromString (__DIR__ . '/../workspace/lib/NamespaceHere/Hallo.php ' )
42+ ]), $ candidates );
43+ }
44+
3645 public function testClassToNoCandidates ()
3746 {
3847 $ candidates = $ this ->classToFile ->classToFileCandidates (ClassName::fromString ('Zog \\Foobar ' ));
Original file line number Diff line number Diff line change @@ -32,6 +32,24 @@ public function testFileToClass()
3232 ]), $ candidates );
3333 }
3434
35+ public function testFileToInterface ()
36+ {
37+ $ candidates = $ this ->fileToClass ->fileToClassCandidates (FilePath::fromString (__DIR__ . '/project/lib/FoobarInterface.php ' ));
38+
39+ $ this ->assertEquals (ClassNameCandidates::fromClassNames ([
40+ ClassName::fromString ('Acme \\FoobarInterface ' )
41+ ]), $ candidates );
42+ }
43+
44+ public function testFileToTrait ()
45+ {
46+ $ candidates = $ this ->fileToClass ->fileToClassCandidates (FilePath::fromString (__DIR__ . '/project/lib/FoobarTrait.php ' ));
47+
48+ $ this ->assertEquals (ClassNameCandidates::fromClassNames ([
49+ ClassName::fromString ('Acme \\FoobarTrait ' )
50+ ]), $ candidates );
51+ }
52+
3553 public function testFileToNoCandidates ()
3654 {
3755 $ candidates = $ this ->fileToClass ->fileToClassCandidates (FilePath::fromString (__DIR__ . '/project/lib/NoClasses.php ' ));
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Acme ;
4+
5+ interface FoobarInterface
6+ {
7+ }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Acme ;
4+
5+ trait FoobarTrait
6+ {
7+ }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Acme \NamespaceHere ;
4+
5+ class Hallo
6+ {
7+ }
You can’t perform that action at this time.
0 commit comments