Codeception Cest继承

时间:2016-02-13 22:50:49

标签: testing codeception

我不确定是否可以扩展Cest文件。在documentation中,您可以扩展您的Cest类以分享常见行为。但是每当我尝试运行我的测试时,我都会发现并且没有找到类异常。

文档错误或我做错了什么?

现在我的基类看起来像这样。

class ServiceCest {
  ...
} 

儿童班看起来像这样。

class CreateServiceCest extends ServiceCest {...}

1 个答案:

答案 0 :(得分:2)

您可以简单地在CreateServiceCest.php

的顶部require_once 'ServiceCest.php';

更高级的方法是在composer.json中配置自动加载 https://getcomposer.org/doc/04-schema.md#psr-4

或者在_bootstrap.php http://codeception.com/docs/reference/Autoload

中设置Codeception Autoloader
相关问题