我对behatch有问题,当我运行bin/behat
命令行时,它向我显示此错误:
“ environment.manager”服务依赖于不存在的“ behatch.http_call.request”服务。
答案 0 :(得分:0)
我有类似的错误
./vendor/bin/behat --verbose
In CheckExceptionOnInvalidReferenceBehaviorPass.php line 86:
[Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException]
The service "environment.manager" has a dependency on a non-existent service "mink".
要解决您的问题,您应该附加behat.yml
。我将介绍三种情况,也许可以为您提供帮助。
default:
suites:
default:
contexts:
- FeatureContext:
kernel: '@kernel'
extensions:
Behat\Symfony2Extension:
kernel:
bootstrap: features/bootstrap/bootstrap.php
class: App\Kernel
添加了Behatch\Extension
但没有Mink\Extension
default:
suites:
default:
contexts:
- FeatureContext:
kernel: '@kernel'
extensions:
Behat\Symfony2Extension:
kernel:
bootstrap: features/bootstrap/bootstrap.php
class: App\Kernel
Behatch\Extension: ~
我添加了两个扩展名Behatch
和MinkExtension
。
default:
suites:
default:
contexts:
- FeatureContext:
kernel: '@kernel'
- Behat\MinkExtension\Context\MinkContext
- behatch:context:browser
- behatch:context:debug
- behatch:context:system
- behatch:context:json
- behatch:context:table
- behatch:context:rest
- behatch:context:xml
extensions:
Behat\Symfony2Extension:
kernel:
bootstrap: features/bootstrap/bootstrap.php
class: App\Kernel
Behatch\Extension: ~
Behat\MinkExtension:
base_url: 'http://localhost:8000'
sessions:
default:
symfony2: ~
来源:
https://github.com/Behat/MinkExtension/blob/master/doc/index.rst https://github.com/Behatch/contexts
解决问题的建议:
--verbose
标志behat.yml
文件