Laravel Testing Service Dependency Injection Error
You cannot inject classes into the tests (as far as i know), given that they are not resolved automatically by laravel/phpUnit.
The correct way is to make
(resolve) them through laravel's app
facade. Your test script should look like this:
<?phpclass SomeValidatorTest extends TestCase{ public function __construct() { $this->validator = \App::make('App\Services\Validators\SomeValidator'); } public function testBasicExample() { $result = $this->validator->doSomething(); }}