尚未在 Mink 上下文 class 上设置 Mink 实例。您是否启用了 Mink 扩展? (运行时异常)
Mink instance has not been set on Mink context class. Have you enabled the Mink Extension? (RuntimeException)
我正在尝试在 Zend 框架 1 上将 mink 与 Behat 一起使用,但是当我 运行 Behat 命令时,我收到此错误 "Mink instance has not been set on Mink context class. Have you enabled the Mink Extension? (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()
{
}
}
在 Behat 3 中,您应该启用 Behat\MinkExtension
而不是 Behat\MinkExtension\Extension
default:
extensions:
Behat\MinkExtension:
base_url: http://en.wikipedia.org
goutte: ~
我正在尝试在 Zend 框架 1 上将 mink 与 Behat 一起使用,但是当我 运行 Behat 命令时,我收到此错误 "Mink instance has not been set on Mink context class. Have you enabled the Mink Extension? (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()
{
}
}
在 Behat 3 中,您应该启用 Behat\MinkExtension
而不是 Behat\MinkExtension\Extension
default:
extensions:
Behat\MinkExtension:
base_url: http://en.wikipedia.org
goutte: ~