-
Notifications
You must be signed in to change notification settings - Fork 325
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ReflectionException: Class config does not exist #99
Comments
I've noticed this too. Currently seeing if I can track down what change caused this. I thought it was the |
PHPUnit 6.0 is the problem here. I upgraded to it too and methods annotated with cc @taylorotwell afaict, it seems like the solution here would be to do the same thing you did with the testing traits and call them explicitly during |
@thecrypticace PR would be awesome :) |
Subbed: Having the same issues with PHPUnit 6.0. |
If I have time this evening I'll investigate what it takes to make Dusk compatible with both. There'll definitely be challenges because PHPUnit 6 was a rather big BC break. |
@thecrypticace any luck? |
Hello guys, can you give us an update on the progress till so far? |
Any update on this bug? Still affecting latest versions. |
Any workaround for this? Other than downgrading phpunit to 5.0 |
Following for a fix for phpunit 6.0 |
Thanks @tomfordweb for bumping this. |
I got this same issue, but not related to phpunit. if you run php artisan clear-compiled while having this issue, it will tell the solution ;) |
same here! MAIL_NAME=company - service
#fix is
MAIL_NAME="company - service" Spaces in .env, without quotes are not valide. But this error msg is confusing. |
I just ran into this as well, adding quotes fixed it. The error message really isn't helpful. |
@moxx it worked for me. |
Had same problem and i've deleted bootstrap/cache/config.php and ran |
Do you have a |
I was have the same problem. Solution: Check your
Off course, you need this file on the same folder |
Hope that this can help you too |
go to the .env file. Make sure that the title contains no space or special character |
i got this problem, now reslove by add code |
saved my day after adding |
Sometime you will get this error if your test function run in a separate process. /**
* @runInSeparateProcess
*/
public function testMyTest()
{
// Your test
} |
sangat bagus sekali |
Removing (any) |
I just want to point out how that looks like in a source file.
Below
|
Just want to note that in Laravel 5.8.35 with PHPUnit 7.5.17 this works...
Note: it's critical to to run you code after parent::setUp(); and before parent::tearDown(); this was the only way I could get it to work. |
Also check if you accidentally extended wrong TestCase class with your test class. |
Laravel's |
Thanks! |
@Casmo Thank You. Removing dump( ) and dd( ) in different files related to the test has helped me to resolve the problem. |
this fixed it for me |
I've experienced the same thing. my fix is
|
Same for me public function setUp()
{
parent::setUp();
\Laravel\Sanctum\Sanctum::actingAs($this->id);
}
public function testOne() // ← This test passed
{
$this->assertTrue(true);
}
/**
* @runInSeparateProcess
*/
public function testTwo() // ← This test failed
{
$this->assertTrue(true);
} The
Error stack traceFatal error: Uncaught ReflectionException: Class config does not exist in /var/www/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 879
Illuminate\Contracts\Container\BindingResolutionException: Target class [config] does not exist. in /var/www/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 879
Call Stack:
0.0012 788920 1. {main}() Standard input code:0
1.8993 8516808 2. require_once('/var/www/config/sanctum.php') Standard input code:677
1.9060 8528864 3. Laravel\Sanctum\Sanctum::currentApplicationUrlWithPort() /var/www/config/sanctum.php:21
1.9060 8528864 4. config($key = 'app.url', $default = ???) /var/www/vendor/laravel/sanctum/src/Sanctum.php:37
1.9060 8528864 5. app($abstract = 'config', $parameters = ???) /var/www/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php:275
1.9060 8528864 6. Illuminate\Foundation\Application->make($abstract = 'config', $parameters = []) /var/www/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php:119
1.9060 8528864 7. Illuminate\Container\Container->make($abstract = 'config', $parameters = []) /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:836
1.9060 8528864 8. Illuminate\Foundation\Application->resolve($abstract = 'config', $parameters = [], $raiseEvents = ???) /var/www/vendor/laravel/framework/src/Illuminate/Container/Container.php:694
1.9060 8528864 9. Illuminate\Container\Container->resolve($abstract = 'config', $parameters = [], $raiseEvents = TRUE) /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:851
1.9060 8529240 10. Illuminate\Container\Container->build($concrete = 'config') /var/www/vendor/laravel/framework/src/Illuminate/Container/Container.php:758 |
Hi guys, recently upgraded a 5.3 project to 5.4 and all seemed good.
Today I started to implement Dusk however had hit an issue when running the example test
I've had a look at line 40 of
TestCase.php
and itsSo it does look like something to do with the global
config
helper anybody have any ideas?I'm running
The full composer.lock can be seen https://gist.github.com/OwenMelbz/c05172b33f6eb4483e37a56469b53722
Fingers crossed you guys have some ideas!
Cheers :)
The text was updated successfully, but these errors were encountered: