日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > php >内容正文

php

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

發布時間:2023/12/10 php 33 豆豆
生活随笔 收集整理的這篇文章主要介紹了 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

總結

以上是生活随笔為你收集整理的php未定义要怎样做,php-Behat-未定义的功能步骤的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。