【发布时间】:2015-07-16 05:56:08
【问题描述】:
我正在尝试在 Zend 框架 1 上将 mink 与 Behat 一起使用,但是当我运行 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()
{
}
}
【问题讨论】:
-
你的完整例子是here
标签: php zend-framework behat mink