/** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function store(CreateUserRequest $request) { $user = new User($request->except('password')); if ($request->has('password')) { $user->password = bcrypt($request->password); } if ($request->has('is_admin')) { $user->is_admin = 1; } $user->save(); return redirect('admin/users'); }
/** * @dataProvider provideBasicRoutes */ public function testFormLoads($method, $route) { $this->actingAs(User::find(1))->call($method, $route); $this->assertResponseOk(); }
public function testEditImageFormLoads() { $this->createTestImage(); $this->actingAs(User::find(1))->call('GET', 'admin/images/1/edit'); $this->assertResponseOk(); }