for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
use Robo\ClassDiscovery\RelativeNamespaceDiscovery;
use Composer\Autoload\ClassLoader;
/**
* Class RelativeNamespaceDiscoveryTest
*/
class RelativeNamespaceDiscoveryTest extends \Codeception\Test\Unit
You can fix this by adding a namespace to your class:
namespace YourVendor; class YourClass { }
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.
{
public function testGetClasses()
$classLoader = new ClassLoader();
$classLoader->addPsr4('\\Robo\\', [realpath(__DIR__.'/../../src')]);
$discovery = new RelativeNamespaceDiscovery('\Commands');
$discovery->setClassLoader($classLoader);
$classes = $discovery->getClasses();
$this->assertContains('\Robo\FirstCustomCommands', $classes);
$this->assertContains('\Robo\SecondCustomCommands', $classes);
}
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.