Update stub for unit tests #39602
Replies: 1 comment
-
|
This is the expected behaviour for |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
PROBLEM
As a newbie to testing, when I run
php artisan make:test SomeTest --unitThen I write a test, and then when I run it, I get this error:
Illuminate\Contracts\Container\BindingResolutionException: Target class [config] does not exist.The problem is that all out-of-the-box generated
--unittests contain this on line 5:use PHPUnit\Framework\TestCase;So one of the first things I do when I create a new test is change this line to:
use Tests\TestCase;SOLUTION:
I can run
php artisan stub:publishAnd update my own copy of
stubs/test.unit.stub.phpBut it would be nice if this worked as expected out of the box.
I plan on submitting a pull request for this momentarily...
Beta Was this translation helpful? Give feedback.
All reactions