我在昨晚工作的Symfony 3项目中编写了一些代码,但现在当我执行sf server:run
时,它会抛出以下错误:
[RuntimeException]
The autoloader expected class "InventoryBundle\InventoryBundle" to be defined in file"/Users/parth/Sites/debate-inventory/src/InventoryBundle/Tests/InventoryBundle.php". The file was found but the class was not in it, the class name or namespace probably has a typo.
我做了一些挖掘工作,在我的捆绑包的根目录中,我有一个名为InventoryBundle.php
的文件,其中包含:
<?php
namespace InventoryBundle;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class InventoryBundle extends Bundle
{
}
但是,系统一直在寻找Tests/InventoryBundle.php
,我最近发现那里有一个文件。该文件包含:
<?php
namespace InventoryBundle\Tests;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class InventoryBundle extends Bundle
{
}
我以前从未使用过测试服务所以我不知道发生了什么。
提前致谢!