我试图在Zend 1上使用带有Behat的mink,但是当我运行Behat命令时,我得到了一个错误"Mink实例没有在Mink上下文类上设置。您启用了Mink扩展吗?(RuntimeException)“
这是我的作曲家:
"behat/behat": "^3.0@dev",
"behat/mink": "1.5.*@stable",
"behat/mink-goutte-driver": "*",
"behat/mink-extension": "*"这是我的behat.yml:
default:
extensions:
Behat\MinkExtension\Extension:
base_url: http://en.wikipedia.org
goutte: ~&这是我的特色:
Feature: Search
In order to see a word definition
As a website user
I need to be able to search for a word
Scenario: Searching for a page that does exist
Given I am on "/wiki/Main_Page"
When I fill in "search" with "Behavior Driven Development"
And I press "searchButton"
Then I should see "agile software development"&我的FeatureContext.php:
<?php
use Behat\Behat\Context\Context;
use Behat\Behat\Context\SnippetAcceptingContext;
use Behat\Gherkin\Node\PyStringNode;
use Behat\Gherkin\Node\TableNode;
use Behat\MinkExtension\Context\MinkContext;
class FeatureContext extends Behat\MinkExtension\Context\MinkContext
{
public function __construct()
{
}
}发布于 2015-07-25 19:45:14
在Behat 3中,您应该启用Behat\MinkExtension而不是Behat\MinkExtension\Extension
default:
extensions:
Behat\MinkExtension:
base_url: http://en.wikipedia.org
goutte: ~https://stackoverflow.com/questions/31446263
复制相似问题