D
D
Dmitry Sokolov2017-05-05 14:57:52
Yii
Dmitry Sokolov, 2017-05-05 14:57:52

Why is the class not connected to the test through use?

Good afternoon!
Codeception is installed globally.
If in the test we connect the class via

require '/var/www/admin/www/project/common/models/Country.php';

then the test passes.
If through
namespace frontend\tests\unit;
use common\models\Country;

then an error is thrown
MePHP Fatal error:  Class 'common\models\Country' not found in /var/www/admin/www/project/frontend/tests/unit/ModelTest.php on line 29
PHP Stack trace:
PHP   1. {main}() /root/.composer/vendor/codeception/codeception/codecept:0

I suspect that the problem is that codeception is running globally, but how to set it up correctly?
Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Timofeev, 2017-05-05
@webinar

stackoverflow.com/questions/29681347/namespaces-no...
is it?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question