|
18 | 18 | $config->shouldReceive('headerFields')->once()->withNoArgs()
|
19 | 19 | ->andReturn(explode(',', 'origin,datetime,status,user,env,agent,ip,host,referer'));
|
20 | 20 | $request = Mockery::mock(Request::class);
|
21 |
| - $app->shouldReceive('offsetGet')->times(2)->with('request')->andReturn($request); |
| 21 | + $app->shouldReceive('offsetGet')->times(3)->with('request')->andReturn($request); |
22 | 22 | $request->shouldReceive('method')->once()->withNoArgs()->andReturn('DELETE');
|
23 | 23 | $request->shouldReceive('fullUrl')->once()->withNoArgs()
|
24 | 24 | ->andReturn('http://example.com/test');
|
| 25 | + $request->shouldReceive('ip')->once()->withNoArgs()->andReturn('127.0.0.1'); |
| 26 | + $request->shouldReceive('userAgent')->once()->withNoArgs()->andReturn('Mozilla/5.0'); |
| 27 | + $request->shouldReceive('header')->once()->with('referer')->andReturn(''); |
25 | 28 |
|
26 | 29 | $now = '2015-03-04 08:12:07';
|
27 | 30 | Carbon::setTestNow($now);
|
|
32 | 35 | ]);
|
33 | 36 | Auth::shouldReceive('check')->once()->withNoArgs()->andReturn(false);
|
34 | 37 | Auth::shouldReceive('user')->once()->withNoArgs()->andReturn(null);
|
35 |
| - \Illuminate\Support\Facades\Request::shouldReceive('ip')->once()->withNoArgs()->andReturn('127.0.0.1'); |
36 |
| - \Illuminate\Support\Facades\Request::shouldReceive('userAgent')->once()->withNoArgs()->andReturn('Mozilla/5.0'); |
37 |
| - \Illuminate\Support\Facades\Request::shouldReceive('header')->once()->with('referer')->andReturn(''); |
38 | 38 |
|
39 | 39 | $formatter = new Formatter($app, $config);
|
40 | 40 | $result = $formatter->getHeader();
|
|
65 | 65 | $config->shouldReceive('headerFields')->once()->withNoArgs()
|
66 | 66 | ->andReturn(explode(',', 'origin,datetime,status,user,env,agent,ip,host,referer'));
|
67 | 67 | $request = Mockery::mock(Request::class);
|
68 |
| - $app->shouldReceive('offsetGet')->once()->with('request')->andReturn($request); |
| 68 | + $app->shouldReceive('offsetGet')->twice()->with('request')->andReturn($request); |
69 | 69 | $request->shouldReceive('server')->once()->with('argv', [])->andReturn('php artisan test');
|
| 70 | + $request->shouldReceive('ip')->once()->withNoArgs()->andReturn('127.0.0.1'); |
| 71 | + $request->shouldReceive('userAgent')->once()->withNoArgs()->andReturn('Mozilla/5.0'); |
| 72 | + $request->shouldReceive('header')->once()->with('referer')->andReturn(''); |
70 | 73 |
|
71 | 74 | $now = '2015-03-04 08:12:07';
|
72 | 75 | Carbon::setTestNow($now);
|
73 | 76 |
|
74 | 77 | DB::shouldReceive('getRawQueryLog')->once()->withNoArgs()->andReturn([]);
|
| 78 | + Auth::shouldReceive('check')->once()->withNoArgs()->andReturn(false); |
75 | 79 | Auth::shouldReceive('user')->once()->withNoArgs()->andReturn(null);
|
76 |
| - \Illuminate\Support\Facades\Request::shouldReceive('ip')->once()->withNoArgs()->andReturn('127.0.0.1'); |
77 |
| - \Illuminate\Support\Facades\Request::shouldReceive('userAgent')->once()->withNoArgs()->andReturn('Mozilla/5.0'); |
78 |
| - \Illuminate\Support\Facades\Request::shouldReceive('header')->once()->with('referer')->andReturn(''); |
79 | 80 |
|
80 | 81 | $formatter = new Formatter($app, $config);
|
81 | 82 | $result = $formatter->getHeader();
|
|
0 commit comments