运行测试时出现错误“定位器未找到类”

时间:2020-01-15 12:46:40

标签: php unit-testing goaop

创建接口类并在User类中实现它后,我的测试立即停止工作。测试抛出此错误:

Class app\models\MyInterface was not found by locator

我发现Go\ParserReflection\ReflectionEngine调用interface_exists($fullClassName, false)并返回false。

有什么解决办法吗?

编辑

我添加了功能测试,现在找不到我用来扩展的BaseController类。

Class app\controllers\BaseController was not found by locator

控制器甚至不在我的$kernel->init(['includePaths' => ...])中,所以我认为应该被goaop忽略吗?

任何输入都会受到赞赏。

1 个答案:

答案 0 :(得分:0)

我已经使用这个 answer 解决了这个问题。 您也可以看看这个问题 on Github