/** * @test */ public function it_can_handle_bad_activation_link() { $statusBefore = 'PENDING'; $this->app['config']->set('laravolt.auth.activation.status_before', $statusBefore); $token = 'asdf1234'; $user = User::create(['name' => 'Citra', 'email' => '*****@*****.**', 'password' => bcrypt('asdf1234'), 'status' => $statusBefore]); DB::table('users_activation')->insert(['user_id' => $user->getKey(), 'token' => $token, 'created_at' => Carbon::now()]); $this->route('GET', 'auth::activate', 'badtoken1234'); $this->assertResponseStatus(404); $this->seeInDatabase((new User())->getTable(), ['id' => $user->getKey(), 'status' => $statusBefore]); }
protected function setUpDatabase() { //if (!file_exists($file = $this->getDatabasePath())) { // touch($file); //} else { // $this->cleanDatabase(); //} $this->createUserTable(); $this->loadMigrationsFrom(['--database' => 'sqlite', '--realpath' => realpath(__DIR__ . '/../database/migrations')]); $this->beforeApplicationDestroyed(function () { $this->cleanDatabase(); }); User::create(['name' => 'Andi', 'email' => '*****@*****.**', 'password' => bcrypt('asdf1234')]); }