2016年2月4日 星期四

Mock Laravel Application

研究了好久的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(); ```