コード例 #1
0
 /**
  * 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');
 }
コード例 #2
0
 /**
  * @dataProvider provideBasicRoutes
  */
 public function testFormLoads($method, $route)
 {
     $this->actingAs(User::find(1))->call($method, $route);
     $this->assertResponseOk();
 }
コード例 #3
0
ファイル: ImageTest.php プロジェクト: philsquare/laramanager
 public function testEditImageFormLoads()
 {
     $this->createTestImage();
     $this->actingAs(User::find(1))->call('GET', 'admin/images/1/edit');
     $this->assertResponseOk();
 }