研究了好久的mockery終於理出一些頭緒了
Laravel的Application的Mock原來如此簡單
```php
m::mock('Illuminate\Container\Container, Illuminate\Contracts\Foundation\Application')
->makePartial()
->shouldReceive('basePath')->andReturn(realpath(__DIR__.'/../').'/')
->shouldReceive('version')->andReturn('5.x.testing')
->shouldReceive('environment')->andReturn('testing')
->mock();
```
沒有留言:
張貼留言