如果在codeception functionall test中调用某些服务的方法,如何检查laravel

时间:2016-01-23 23:06:33

标签: laravel tdd codeception

我有一个codeception cest测试,我想在其中检查是否调用了某个方法。

public function my_test(FunctionalTester $I)
{

    $I->authenticateTestUser($I);
    $this->fillKomitentForm($I, 'kom1', 'Komitent 1');
    $I->click('btnSave');

    // Here I want to check that MyService.myMethod() is invoked

}

我可以帮忙,但无论如何我不知道如何确保调用某些对象上的某些方法。考虑到这是Laravel 5.2并且这些服务是使用服务提供商绑定的。

1 个答案:

答案 0 :(得分:0)

尝试使用AspectMock

其中一项功能是Create test doubles for class methods called anywhere