symfony2和phpunit在Lampp上不起作用(ubuntu 15.x) [英] symfony2 and phpunit does not work on lampp (ubuntu 15.x)

查看:68
本文介绍了symfony2和phpunit在Lampp上不起作用(ubuntu 15.x)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的symfony2应用程序在wamp(windows)上可以完美地与phpunit一起使用,但是当更改环境并在安装后开始在lampp(linux)上运行时,通过键入phpunit -c app/运行测试时出现以下错误:`/opt/lampp/htdocs/VTALLY/src/Iballot/CmsBundle/Tests/Controller/ParliamentaryControllerTest.php:11

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

由 Symfony \ Component \ Yaml \ Exception \ ParseException:保留指示符"@"无法启动纯标量;您需要在第4行引用标量(在参数:[@ security.context,@ fos_user.user_manager]"附近)).

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]").`

推荐答案

您需要将任何以@开头的字符串放在引号中

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

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

保留的字符(如@)应加引号. Symfony 2.8中不推荐使用未引用@. Symfony 3.0将禁止您使用此类定义,并会引发异常.

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.

如果您无法控制注册有问题的配置的捆绑软件,请向供应商发送包含修复程序的请求请求.作为快速修复,您可以降级Symfony. 2.7和2.8都可以使用(后者只会发出弃用通知).

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).

这篇关于symfony2和phpunit在Lampp上不起作用(ubuntu 15.x)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆