gpt4 book ai didi

php - Mink 实例尚未在 Mink 上下文类上设置。您是否启用了 Mink 扩展? (运行时异常)

转载 作者:塔克拉玛干 更新时间:2023-11-03 05:38:11 26 4
gpt4 key购买 nike

我正在尝试在 Zend 框架 1 上将 mink 与 Behat 一起使用,但是当我运行 Behat 命令时,我收到此错误“Mink 实例尚未在 Mink 上下文类上设置。您是否启用了 Mink 扩展?(RuntimeException)”

这是我的 Composer :

"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: ~

关于php - Mink 实例尚未在 Mink 上下文类上设置。您是否启用了 Mink 扩展? (运行时异常),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31446263/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com