mercredi 25 juillet 2018

Yii2 codeception unit testing 'cannot see' model class

I'm trying to perform some unit tests in Yii2 advanced template, using codeception. My sample test class:

class SampleTest extends \Codeception\Test\Unit
{
/**
* @var \UnitTester
*/
protected $tester;

protected function _before()
{
    $this->c = new \common\models\DocumentDetail();

}

output is:

1) SampleTest: Some feature 
Test  tests\unit\SampleTest.php:testSomeFeature
[Error] Class 'common\models\DocumentDetail' not found                                                    

It happens while, testing my project and some fresh-installed official demo from github.

Aucun commentaire:

Enregistrer un commentaire