【发布时间】:2017-04-24 23:38:50
【问题描述】:
我在一个 sylius 项目中工作,并且我进行了一些功能测试。碰巧 sylius 已经切换到 symfony 3.2 并且在此之后我的许多测试都不再工作了。
每当我尝试运行测试时,我都会遇到类似的错误
Doctrine\Common\Annotations\AnnotationException: [Semantical Error] The annotation "@Doctrine\ORM\Mapping\Entity" in class ...\Entity\Block does not exist, or could not be auto-loaded.
我的 phpunit.xml 看起来像
<?xml version="1.0" encoding="UTF-8"?>
<phpunit colors="true"
bootstrap="var/bootstrap.php.cache">
<php>
<server name="KERNEL_DIR" value="./app" />
</php>
<testsuites>
<testsuite name="Application Test Suite">
<directory>./src/AppBundle/Tests/</directory>
</testsuite>
</testsuites>
最后,我的测试有这种设置
abstract class BaseTestCase extends KernelTestCase {
...
protected function setUp()
{
static::bootKernel();
}
}
知道我的设置可能有什么问题吗?
【问题讨论】:
标签: doctrine-orm phpunit symfony