我们对捆绑包https://github.com/liip/LiipTestFixturesBundle/tree/2.x有问题(请注意,我是该捆绑包的维护者之一,问题不在于在项目中使用该捆绑包)
主2.x
分支上的测试因以下错误而中断:
Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException:服务“nelmio_alice.property_accessor.std”依赖于不存在的服务“property_accessor”。你的意思是:“nelmio_alice.property_accessor.std”?
以下是该服务的声明方式vendor/nelmio/alice/src/Bridge/Symfony/Resources/config/property_access.xml
:
<service id="nelmio_alice.property_accessor.std"
class="Nelmio\Alice\PropertyAccess\StdPropertyAccessor">
<argument type="service" id="property_accessor" />
</service>
应该调用此代码,因为NelmioAliceBundle
它是在AppKernel
.
因此,我们将其添加到composer.json
禁止symfony/property-access 5.3
并修复了错误:
"symfony/property-access": "^4.4 || ^5.0 , <5.3",
但是,如果我们删除该解决方法,它会再次中断。而且我不明白是什么导致了这个问题。
禁止symfony/framework-bundle
5.3 也解决了这个问题:https ://github.com/liip/LiipTestFixturesBundle/pull/127/commits/a534419e61ef90ca2685d697b89b2ce225712cdc
property_accessor
当我们使用symfony/framework-bundle
5.3 或5.3 时,是什么导致了缺失symfony/property-access
?
如何复制错误
git clone git@github.com:liip/LiipTestFixturesBundle.git
cd LiipTestFixturesBundle
git checkout remove-required-symfony/property-access
composer install
vendor/bin/phpunit --testdox tests/Test/ConfigEventsTest.php