Пример #1
0
 /**
  * Update existing user
  *
  * @param  integer $id
  * @return Redirect
  */
 public function update($id)
 {
     $user = $this->user->update($id, Input::all());
     return Redirect::route('backend.system.users.edit', $id);
 }
 /** @test **/
 function it_updates_the_data_given_id_and_attributes()
 {
     $user = factory(User::class)->create(['name' => 'Gregory House', 'email' => '*****@*****.**']);
     $repository = new UserRepository($this->newContainerMock(new User()));
     $user = $repository->update($user->id, ['name' => 'James Wilson', 'email' => '*****@*****.**']);
     $this->assertEquals('James Wilson', $user->name);
     $this->assertEquals('*****@*****.**', $user->email);
 }