【问题标题】:Using Behat 2.0, Where should i put my steps?使用 Behat 2.0,我应该把我的步骤放在哪里?
【发布时间】:2011-09-30 21:56:48
【问题描述】:
You can implement step definitions for undefined steps with these snippets:

/**
 * @Given /^people enter (\d+)$/
 */
public function peopleEnter($argument1)
{
    throw new Pending();
}

我应该把它放在 bootstrap.php 下吗?我真的很困惑我应该知道什么... 我想使用 oop 风格,而不是闭包。 我是 BDD 和 Behat 的新手。 欢迎任何帮助。 谢谢

【问题讨论】:

    标签: unit-testing testing bdd behavior dml


    【解决方案1】:

    是的,把它放在引导程序中。默认情况下,Behat 会查找 bootstrap/FeatureContext.php 作为其引导文件,但这些方法应该进入您使用的扩展 BehatContext 的任何引导类。

    【讨论】:

      猜你喜欢
      • 2020-09-30
      • 2019-07-11
      • 1970-01-01
      • 2016-08-25
      • 2013-08-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多