public function testFindByName() { Sentry::shouldReceive('findGroupByName')->with('Admin')->once()->andReturn(array()); $this->assertEquals(array(), $this->groups->findByName('Admin')); Sentry::shouldReceive('findGroupByName')->once()->andThrow('Cartalyst\\Sentry\\Groups\\GroupNotFoundException'); $this->assertFalse($this->groups->findByName('Moderator')); $this->assertNotNull($this->groups->getError()); }
/** * Update the specified group in storage. * * @param int $id */ public function update($id) { $input = array('name' => Input::get('name'), 'permissions' => Input::get('permissions', array())); if ($this->groups->update($id, $input)) { return Redirect::route('groups.index'); } return Redirect::route('groups.index')->with(array('not_updated' => $this->groups->getError())); }