尚未在Mink上下文类上设置Mink实例。你启用了Mink Extension吗? (RuntimeException的)

时间:2015-07-16 05:56:09

标签: php zend-framework behat mink

我试图在Zend框架1上使用mink与Behat,但是当我运行Behat命令时,我得到了这个错误" Mink实例尚未在Mink上下文类中设置。你启用了Mink Extension吗? (RuntimeException的)"

这是我的作曲家:

"behat/behat": "^3.0@dev",
"behat/mink": "1.5.*@stable",
"behat/mink-goutte-driver": "*",
"behat/mink-extension": "*"

& here' s behat.yml:

default:
    extensions:
        Behat\MinkExtension\Extension:
            base_url: http://en.wikipedia.org
            goutte: ~

& here这是我的特色:

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()
    {
    }
}

1 个答案:

答案 0 :(得分:3)

在Behat 3中,您应该启用Behat\MinkExtension而不是Behat\MinkExtension\Extension

default:
    extensions:
        Behat\MinkExtension:
            base_url: http://en.wikipedia.org
            goutte: ~