symfony2 and phpunit does not work on lampp (ubuntu 15.x)

会有一股神秘感。 提交于 2019-12-12 19:27:08

问题


My symfony2 application is working with phpunit perfectly on wamp (windows) but when a change the environment and start to work on lampp (linux) after installing, I get the following error when run the test by typing phpunit -c app/: `/opt/lampp/htdocs/VTALLY/src/Iballot/CmsBundle/Tests/Controller/ParliamentaryControllerTest.php:11

Caused by Symfony\Component\Yaml\Exception\ParseException: The reserved indicator "@" cannot start a plain scalar; you need to quote the scalar at line 4 (near "arguments: [@security.context, @fos_user.user_manager]").`


回答1:


You need to put any strings starting with @ in quotes:

arguments:
    ["@security.context", "@fos_user.user_manager"]

Reserved characters, like @, should be quoted. Unquoted @s were deprecated in Symfony 2.8. Symfony 3.0 will forbid you to use such definitions and will throw an exception.

If you don't have control over the bundle that registered the problematic configuration, send a pull request with a fix to the vendor. As a quick fix you can downgrade Symfony. 2.7 will work, as well as 2.8 (the later will only emit a deprecation notice).



来源:https://stackoverflow.com/questions/34990017/symfony2-and-phpunit-does-not-work-on-lampp-ubuntu-15-x

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!