Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/symfony/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php app/config中的behat.yml而不是根目录_Php_Symfony_Composer Php_Behat_Mink - Fatal编程技术网

Php app/config中的behat.yml而不是根目录

Php app/config中的behat.yml而不是根目录,php,symfony,composer-php,behat,mink,Php,Symfony,Composer Php,Behat,Mink,我为我的Symfony2项目安装了带有mink和selenium2驱动程序的behat 是否可以使用/app/config/behat.yml而不是/behat.yml文件 我在谷歌上搜索过,但在这个命令中我找不到其他任何东西 php bin/behat --config app/config/behat.yml 但是命令也不起作用。 我认为composer.json中必须有一个配置路径。是的,您可以配置要使用的配置文件。请看文档的这部分。 运行命令时会出现什么错误 php bin/beha

我为我的Symfony2项目安装了带有mink和selenium2驱动程序的behat

是否可以使用
/app/config/behat.yml
而不是
/behat.yml
文件

我在谷歌上搜索过,但在这个命令中我找不到其他任何东西

php bin/behat --config app/config/behat.yml
但是命令也不起作用。

我认为composer.json中必须有一个配置路径。

是的,您可以配置要使用的配置文件。请看文档的这部分。

运行命令时会出现什么错误

php bin/behat --config app/config/behat.yml
这个错误

[RuntimeException]                                                         
Context class not found.                                                   
Maybe you have provided a wrong or no `bootstrap` path in your behat.yml:  
http://docs.behat.org/guides/7.config.html#paths
如果是这种情况,我认为可能是因为您需要指定在behat.yml文件中查找功能的位置

现在已将文件移动到/app/config/behat.yml,从behat.yml到功能目录的相关路径已更改,因此应将以下内容添加到文件中:

default:
    paths:
         features: ../features/
         bootstrap: ../features/bootstrap

如果没有
--config app/config/behat.yml
,则无法运行该命令?是的,它也可以运行。默认情况下,behat在项目的根目录或config/behat.yml中查找文件behat.yml。但是从behat.yml到feature目录的路径仍然会被破坏,因此您仍然需要编辑文件内的路径。不起作用。。。我在
/var/www
中,
behat.yml
/var/www/app/config/behat.yml
中,二进制文件在
/var/www/bin/behat
中。配置包含
默认:路径:功能:../features引导:../features/asd
(我将引导目录重命名为asd以进行测试)尝试使用
%behat.path.base%/../features
也不起作用。。。。问题是behat忽略app/config/behat.yml文件!如果我在文件(没有yaml格式)中写入“test”并执行
php-bin/behat--config-app/config/behat.yml
我得到的
无法在第2行的“app\/config\/behat.yml”中解析(靠近“test”)。
但是如果我使用
php-bin/behat
我得到的
上下文类找不到。
。因为该behat忽略了behat.yml。