首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >没有在Mink上下文类上设置Mink实例。你启用Mink分机了吗?(RuntimeException)

没有在Mink上下文类上设置Mink实例。你启用Mink分机了吗?(RuntimeException)
EN

Stack Overflow用户
提问于 2015-07-16 05:56:08
回答 1查看 3.6K关注 0票数 6

我试图在Zend 1上使用带有Behat的mink,但是当我运行Behat命令时,我得到了一个错误"Mink实例没有在Mink上下文类上设置。您启用了Mink扩展吗?(RuntimeException)“

这是我的作曲家:

代码语言:javascript
复制
"behat/behat": "^3.0@dev",
"behat/mink": "1.5.*@stable",
"behat/mink-goutte-driver": "*",
"behat/mink-extension": "*"

这是我的behat.yml:

代码语言:javascript
复制
default:
    extensions:
        Behat\MinkExtension\Extension:
            base_url: http://en.wikipedia.org
            goutte: ~

&这是我的特色:

代码语言:javascript
复制
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:

代码语言:javascript
复制
<?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()
    {
    }
}
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-07-25 19:45:14

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

代码语言:javascript
复制
default:
    extensions:
        Behat\MinkExtension:
            base_url: http://en.wikipedia.org
            goutte: ~
票数 5
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/31446263

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档