/** * Test that the format args method in the application returns an empty array when an exception is thrown * * @return void * @author Dan Cox */ public function test_formatArgsReturnsEmptyOnException() { $library = m::mock('TaskLibrary'); $dispatch = m::mock('Dispatch'); $library->shouldReceive('add'); $library->shouldReceive('getAll')->andReturn([]); $library->shouldReceive('find')->andThrow('Exception'); $dispatch->shouldReceive('setDefaultTask'); $dispatch->shouldReceive('setDefaultAction'); $dispatch->shouldReceive('setTaskSuffix'); $dispatch->shouldReceive('setActionSuffix'); $dispatch->shouldReceive('setDI'); $dispatch->shouldReceive('dispatch')->once(); $app = new Application(new DI(), $dispatch, $library); $app->start(['test', 'test']); }