public function testDelete() { $mock = m::mock('Group'); $mock->shouldReceive('delete')->once()->andReturn(true); Sentry::shouldReceive('findGroupById')->with(1)->once()->andReturn($mock); $this->assertTrue($this->groups->delete(1)); Sentry::shouldReceive('findGroupById')->once()->andThrow('Cartalyst\\Sentry\\Groups\\GroupNotFoundException'); $this->assertFalse($this->groups->delete(10)); }
/** * Remove the specified group from storage. * * @param int $id */ public function destroy($id) { $this->groups->delete($id); return Redirect::route('groups.index'); }