php – Laravel Dusk – 类配置不存在

最近将5.3项目升级到5.4,一切都很好.

今天我开始实施Dusk但是在运行示例测试时遇到了问题

☁  footy-finance [5.4] ⚡ php artisan dusk
PHPUnit 6.0.0 by Sebastian Bergmann and contributors.

E                                                                   1 / 1 (100%)

Time: 162 ms, Memory: 6.00MB

There was 1 error:

1) Tests\Browser\ExampleTest::testBasicExample
ReflectionException: Class config does not exist

/Users/owen/Sites/footy-finance/vendor/laravel/framework/src/Illuminate/Container/Container.php:681
/Users/owen/Sites/footy-finance/vendor/laravel/framework/src/Illuminate/Container/Container.php:565
/Users/owen/Sites/footy-finance/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php:105
/Users/owen/Sites/footy-finance/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php:263
/Users/owen/Sites/footy-finance/vendor/laravel/dusk/src/TestCase.php:203
/Users/owen/Sites/footy-finance/vendor/laravel/dusk/src/TestCase.php:40

我已经看过TestCase.php的40行及其版本

public function baseUrl()
{
    return config('app.url');
}

所以它确实与全局配置助手有关,任何人都有任何想法吗?

我在跑

> PHP 7.0.14
> Laravel / Framework 5.4.8
> Laravel / Dusk 1.0.5

完整的composer.lock可以看到https://gist.github.com/OwenMelbz/c05172b33f6eb4483e37a56469b53722

手指穿过你们有些想法!

干杯:)

最佳答案
我在日志中遇到此错误

Class config does not exist

我的问题是在.env文件中我用以下方式设置了一个配置变量:

APP_NAME=Application Name

注意空间.当我把它更改为:

APP_NAME="Application Name" 

问题得到解决

转载注明原文:php – Laravel Dusk – 类配置不存在 - 代码日志