Total Complexity | 1 |
Total Lines | 18 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
11 | trait InteractsWithApp |
||
12 | { |
||
13 | /** @var App|MockInterface */ |
||
14 | protected $app; |
||
15 | |||
16 | /** @var Config|MockInterface */ |
||
17 | protected $config; |
||
18 | |||
19 | protected function prepareApp() |
||
20 | { |
||
21 | $this->app = m::mock(App::class)->makePartial(); |
||
22 | Container::setInstance($this->app); |
||
23 | $this->app->shouldReceive('make')->with(App::class)->andReturn($this->app); |
||
24 | $this->app->shouldReceive('isDebug')->andReturnTrue(); |
||
25 | $this->config = m::mock(Config::class)->makePartial(); |
||
26 | $this->config->shouldReceive('get')->with('app.show_error_msg')->andReturnTrue(); |
||
27 | $this->app->shouldReceive('get')->with('config')->andReturn($this->config); |
||
28 | $this->app->shouldReceive('runningInConsole')->andReturn(false); |
||
29 | } |
||
31 |