我肯定错过了什么 ; 我正在尝试运行一些测试,但由于命名空间的原因,从未找到这些类。
这是我的结构。
-app
-tests
-Unit
-TestInterface.php
-common
-MyTest.php
这是我的 TestInterface.php:
namespace App\Tests\Unit;
interface TestInterface
{
}
这是我的 MyTest.php:
namespace App\Tests\Unit\common;
use App\Tests\Unit\TestInterface;
class MyTest implements TestInterface
{
}
这是 composer.json 的相关部分:
"autoload": {
"psr-4": {
"App\\": "src/",
"spec\\": "spec/"
}
},
"autoload-dev": {
"psr-4": {
"App\\Tests\\": "tests/"
}
},
这是错误:
PHP Fatal error: Interface 'App\Tests\Unit\TestInterface' not found
我在这里缺少什么?
慕桂英4014372