如何使用phalcon的多模块设置来设置PHPUnit测试?

时间:2015-03-09 13:31:12

标签: phpunit phalcon

我已经使用单一设置创建了一个测试应用程序,并根据教程http://docs.phalconphp.com/en/latest/reference/unit-testing.html使用了PHPUnit并且运行良好。

有人可以帮助我如何为多模块设置设置它吗?

1 个答案:

答案 0 :(得分:1)

单元测试并不关心应用是单模还是多模。给出了测试套件中给出DI和配置的示例。例如,如果要在UserModule中测试AddUser函数,则必须创建User对象并模拟其依赖项。然后在单元测试中调用它。

$user = new \App\Module\User\User.php;
$this->assertTrue($user->addUser());