Unable to successfully mock Config::shouldReceive('get')->with('my_testing_param_here');
because the application boots and it will start to ask you for every single required app configuration parameter
My test started to look like this before I called it quits:
Config::shouldReceive('offsetGet')
->with('database.default')
->andReturn('DEFAULT_DATABASE')
;
Config::shouldReceive('offsetGet')
->with('database.connections')
->andReturn(['DEFAULT_DATABASE' => [
'driver' => 'mysql',
'host' => 'HOST'
'database' => 'DATABASE',
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
'strict' => false,
]])
;
Config::shouldReceive('offsetGet')->with('database.fetch');
// never ending configuration parameters until the application is fully booted
This is totally untestable if you're trying to just get a Config value. Is there a shortcut method out there?
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community