php未定义要怎样做,php-Behat-未定义的功能步骤

我设置了一个简单的测试场景来学习behat,但是我遇到了一些问题.我正在关注THIS教程.

这是我的专题节目:

Feature: show

This is a behat feature to test the article pages.

##TODO

Scenario: I want to view a detailed article page

Given I am logged in

And I'm on "/articles"

When I press an article Image

Then I should see a title

And I should see an Image

And I should see some text

这是我的FeatureContext.php文件

use Behat\MinkExtension\Context\MinkContext;

/**

* Features context.

*/

class FeatureContext extends MinkContext

{

/**

* Initializes context.

* Every scenario gets its own context object.

*/

public function __construct()

{

}

/**

* @Given /^I am on "([^"]*)"$/

*/

public function iAmOn($arg1)

{

throw new PendingException();

}

/**

* @Given /^I press "([^"]*)"$/

*/

public function iPress($arg1)

{

throw new PendingException();

}

/**

* @When /^I fill in "([^"]*)" with "([^"]*)"$/

*/

public function iFillInWith($arg1, $arg2)

{

throw new PendingException();

}

/**

* @Then /^I should see "([^"]*)" in the "([^"]*)" element$/

*/

public function iShouldSeeInTheElement($arg1, $arg2)

{

throw new PendingException();

}

}

但是,每次我尝试运行该功能时,都会得到相同的结果,如下所示:

Feature: show

This is a behat feature to test the article pages.

Scenario: I want to view a detailed article page # features\show.feature:5

Given I am logged in

And I'm on "/articles"

When I press an article Image

Then I should see a title

And I should see an Image

And I should see some text

1 scenario (1 undefined)

6 steps (6 undefined)

0m0.32s (4.78Mb)

我不确定是什么引起了这个问题.我一直在寻找解决方案,但找不到.我希望你们中的一个能帮助我!

提前致谢

解决方法:

您的步骤与步骤定义不匹配.

您可以通过在FeatureContext中实现SnippetAcceptingContext并使用–append-snippets参数运行Behat来让Behat创建步骤定义的存根,如下所述:

标签:behat,laravel-5-1,php

来源: https://codeday.me/bug/20191119/2035956.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值