Codeception CEST acceptanse测试,如何在每次测试之前重新运行__bootstrap代码?

时间:2016-08-23 14:50:56

标签: laravel codeception acceptance-testing

我正在使用Codeception来验证我的代码。我需要的是在每次测试之前重新运行迁移和种子(我在_bootstrap文件中指定)。我怎样才能做到这一点?

1 个答案:

答案 0 :(得分:0)

如果要在所有验收测试之前运行该代码,请将该代码移至_support\Helper\Acceptance.php的_before方法。

http://codeception.com/docs/06-ModulesAndHelpers#Hooks

namespace Helper;

class Acceptance extends \Codeception\Module
{
    public function _before(\Codeception\TestInterface $test) {
    {
        // migrations
        // seeding
    }
}
相关问题