Answer the question
In order to leave comments, you need to log in
Why doesn't the autoloader work in PHPUnit tests (Class not found)?
I can't figure out why PHPUnit test throws an error Class 'app\someDir\SomeClass' not found
projectName\someDir\SomeClass.php
namespace app\someDir;
class SomeClass { }
namespace app\tests;
use app\someDir\SomeClass;
class SomeTest extends \PHPUnit\Framework\TestCase
{ /* работа с классом SomeClass */ }
"autoload": {
"psr-4": {
"app\\": ""
}
}
php phpunit --bootstrap projectName/vendor/autoload.php projectName\tests
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question