コード例 #1
0
ファイル: AuthTest.php プロジェクト: philsquare/laramanager
 public function testResetPassword()
 {
     $this->visit('admin/auth/password/email')->type('*****@*****.**', 'email')->press('Send Password Reset Link')->seePageIs('admin/auth/password/email');
     $reset = DB::table('password_resets')->where('email', '*****@*****.**')->select('token')->first();
     $resetLink = url('admin/auth/password/reset/' . $reset->token);
     $this->visit($resetLink)->type('*****@*****.**', 'email')->type('newPassword', 'password')->type('newPassword', 'password_confirmation')->press('Reset Password')->seePageIs('admin/dashboard');
     $user = User::find(1);
     $this->assertTrue(Hash::check('newPassword', $user->password));
 }
コード例 #2
0
ファイル: UserTest.php プロジェクト: philsquare/laramanager
 public function testEditUserForm()
 {
     $this->actingAs(User::find(1))->visit('admin/users/1/edit')->type('Admin2', 'name')->type('*****@*****.**', 'email')->type('newPassword', 'password')->press('Update')->seePageIs('admin/users');
     $retrievedResource = User::find(1);
     $this->assertEquals('Admin2', $retrievedResource->name);
     $this->assertEquals('*****@*****.**', $retrievedResource->email);
     $this->assertTrue(Hash::check('newPassword', $retrievedResource->password));
     $this->assertEquals('1', $retrievedResource->is_admin);
 }
コード例 #3
0
 /**
  * A basic functional test example.
  *
  * @return void
  */
 public function testCreateResource()
 {
     $this->actingAs(User::find(1))->visit('admin/resources/create')->type('Events', 'title')->type('events', 'slug')->type('Laradev', 'namespace')->type('Models\\Event', 'model')->type('0', 'order_column')->type('asc', 'order_direction')->type('uk-icon-calendar', 'icon')->press('Save')->seePageIs('admin/resources/1/fields');
     $retrievedResource = Resource::find(1);
     $this->assertEquals('Events', $retrievedResource->title);
     $this->assertEquals('events', $retrievedResource->slug);
     $this->assertEquals('Laradev', $retrievedResource->namespace);
     $this->assertEquals('Models\\Event', $retrievedResource->model);
     $this->assertEquals('0', $retrievedResource->order_column);
     $this->assertEquals('asc', $retrievedResource->order_direction);
     $this->assertEquals('uk-icon-calendar', $retrievedResource->icon);
 }