Conditions | 1 |
Paths | 1 |
Total Lines | 13 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
11 | public function testGetClasses() |
||
12 | { |
||
13 | $classLoader = new ClassLoader(); |
||
14 | $classLoader->addPsr4('\\Robo\\', [realpath(__DIR__.'/../../src')]); |
||
15 | |||
16 | $discovery = new RelativeNamespaceDiscovery('\Commands'); |
||
17 | $discovery->setClassLoader($classLoader); |
||
18 | |||
19 | $classes = $discovery->getClasses(); |
||
20 | |||
21 | $this->assertContains('\Robo\FirstCustomCommands', $classes); |
||
22 | $this->assertContains('\Robo\SecondCustomCommands', $classes); |
||
23 | } |
||
24 | } |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.