Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/251.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Behat-未定义的特征步骤_Php_Laravel 5.1_Behat - Fatal编程技术网

Php Behat-未定义的特征步骤

Php Behat-未定义的特征步骤,php,laravel-5.1,behat,Php,Laravel 5.1,Behat,我设置了一个简单的测试场景来学习behat,但我遇到了一些问题。我正在学习教程 这是我的特辑: 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

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

这是我的特辑

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文件

        <?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();
        }
}
我不确定是什么导致了这个问题。我一直在寻找解决办法,但找不到。我希望你们中的一个能帮助我


提前感谢

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

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


有一个关于
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)