public function test_it_can_delete_a_saved_file()
 {
     Session::start();
     $this->login();
     $this->seedSavedFiles();
     $this->delete('gdrive/files/' . static::SEED_FILE_ID, ['_token' => csrf_token()])->notSeeInDatabase('gdrive_files', ['id' => static::SEED_FILE_ID]);
 }
Esempio n. 2
0
 /**
  * @test
  */
 function it_hashes_a_password()
 {
     Session::start();
     \Illuminate\Support\Facades\Hash::shouldReceive('make')->once()->andReturn('foobar_hashed_password');
     $response = $this->action('POST', 'HashingController@postIndex', ['password' => 'foobar_password', '_token' => csrf_token()]);
     $this->assertEquals('Your hash is foobar_hashed_password', $response->getContent());
 }
Esempio n. 3
0
 public function setUp()
 {
     parent::setUp();
     \Birdmin\Product::where('name', 'Test Product')->delete();
     Session::start();
     $this->be(User::find(1));
 }
 public function testCreateArticleSuccess()
 {
     $this->userLoggedIn();
     $this->repositoryMock->shouldReceive('create')->once();
     Session::start();
     // Start a session for the current test
     $this->call('POST', 'articles', ['title' => 'subject 999', 'body' => 'body 999', '_token' => csrf_token()]);
     $this->assertRedirectedToRoute('articles.index');
 }
 protected function setupData()
 {
     // Added Session Start to properly test CSRF Token
     Session::start();
     $roleData = ['name' => 'Registered', 'slug' => 'registered'];
     $roleData2 = ['name' => 'Administrator', 'slug' => 'administrator', 'permissions' => ['admin' => "1"]];
     $userData = ['email' => '*****@*****.**', 'password' => 'test', 'password_confirmation' => 'test'];
     $this->role->create($roleData);
     $this->adminRole = $this->role->create($roleData2);
     $this->auth->registerAndActivate($userData, false);
 }
 public function auth()
 {
     $this->checkCookie();
     if (Session::get('has_access')) {
         return redirect('/profile');
     } else {
         if (!Session::has('error')) {
             Session::start();
         }
         return response()->view('auth_form');
     }
 }
 public function prepare()
 {
     Session::start();
     $this->artisan('migrate', ['--path' => 'packages/genealabs/laravel-governor/database/migrations']);
     $this->artisan('migrate', ['--path' => 'database/secondaryMigrations']);
     $this->superAdminUser = factory(LaravelGovernorTests\User::class)->create();
     $this->artisan('db:seed', ['--class' => 'LaravelGovernorDatabaseSeeder']);
     $this->unauthorizedUser = factory(LaravelGovernorTests\User::class)->create();
     $this->superAdminUser->fill(['name' => 'Test User', 'first_name' => 'Test', 'last_name' => 'User', 'email' => '*****@*****.**', 'password' => 'test123$']);
     $this->superAdminUser->save();
     $this->rolePolicy = new RolePolicy();
     $this->entityPolicy = new EntityPolicy();
     $this->assignmentPolicy = new AssignmentPolicy();
     $this->superAdminRole = Role::find('SuperAdmin');
     $this->memberRole = Role::find('Member');
     $this->role = new Role();
     $this->entity = new Entity();
     $this->assignment = new Assignment();
     $this->memberUser = User::limit(2)->get()->last();
 }
 public function testLocalizationData()
 {
     Session::start();
     $this->be(User::find(1));
     $this->post('/vehicle/dashboard/localization', ['vehicle_id' => 1, "_token" => csrf_token()])->assertResponseStatus(200);
 }
 public function setUp()
 {
     parent::setUp();
     Session::start();
     $this->be(User::find(1));
 }
 public function setUp()
 {
     parent::setUp();
     Session::start();
 }