Hi,
I am starting to use Codeception for Unit testing within Yii2. Great that Yii2 embraces it completely now, a major reason for me to upgrade!
I am having difficulties letting codeception find the classes, that are autoloaded in the Yii2 application.
E.g.
<?php
class VerifyComTest extends \Codeception\TestCase\Test
{
/**
* @var \UnitTester
*/
protected $tester;
protected function _before()
{
}
protected function _after()
{
}
// tests
public function testMe()
{
echo \app\controllers\RecipesController::getallrecipes();
}
}
results when I do codeception run unit in this output:
FATAL ERROR. TESTS NOT FINISHED.
Class ‘app\controllers\RecipesController’ not found
My _bootstrap.php file includes this:
require_once(__DIR__ . '/../../vendor/autoload.php');
require_once(__DIR__ . '/../../vendor/yiisoft/yii2/Yii.php');
so I am clueless to what I am doing wrong?
Thanks for anyone’s help.
Alex