public function test_can_verify_email()
 {
     Notification::fake();
     $this->post(route('front::register.post'), ['name' => 'test-user', 'email' => '*****@*****.**', 'password' => 'password', 'password_confirmation' => 'password', 'terms' => 1, 'g-recaptcha-response' => 1]);
     $user = User::where('email', '*****@*****.**')->first();
     Notification::assertSentTo($user, VerifyEmailNotification::class);
     $emailVerification = EmailVerification::latest()->first();
     $this->visit($emailVerification->link)->seeSuccessMessage(trans('authentication::verification.success'))->dontSeeInDatabase('email_verifications', ['email' => 'testuser@example']);
 }
 public function test_unverified_manual_user_log_in()
 {
     $user = $this->createUser(false);
     $provider = $this->getProviderName();
     $oauthUser = $this->mockDriver($provider, ['name' => $user->name, 'email' => $user->email]);
     $this->action('GET', $this->getAction('handleProviderCallback'), $provider);
     $this->assertRedirectWithNoErrors();
     $this->seeInDatabase('users', ['email' => $oauthUser->getEmail(), 'name' => $oauthUser->getName(), $provider . '_id' => $oauthUser->getId()]);
     $user = User::where('email', $oauthUser->getEmail())->first();
     $this->assertNotNull($user->verified_at);
 }
Esempio n. 3
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     /*
     |--------------------------------------------------------------------------
     | Create dummy users
     |--------------------------------------------------------------------------
     */
     factory(User::class, 'verified', 20)->create();
     /*
     |--------------------------------------------------------------------------
     | Init sellers and create shops
     |--------------------------------------------------------------------------
     */
     $users = User::all();
     foreach ($users as $user) {
         if ($this->faker->boolean(50)) {
             $this->initSeller($user);
         }
     }
     foreach (getTestAccounts() as $testAccount) {
         $testUser = User::where('email', $testAccount['email'])->first();
         if (!$testUser->isShopOwner()) {
             $this->initSeller($testUser);
         }
     }
     /*
     |--------------------------------------------------------------------------
     | Seed common data for users and shops
     |--------------------------------------------------------------------------
     */
     // select 80% of users and assign 1 to 3 addresses
     foreach ($users as $user) {
         $this->seedCommonData($user);
     }
     $shops = Shop::all();
     // select 80% of sellers and assign 1 to 3 address
     foreach ($shops as $shop) {
         $this->seedCommonData($shop);
     }
     /*
     |--------------------------------------------------------------------------
     | Seed seller data for users and shops
     |--------------------------------------------------------------------------
     */
     foreach ($shops as $shop) {
         if ($this->faker->boolean(80)) {
             $this->seedSellerData($shop);
         }
     }
     foreach ($users as $user) {
         if ($this->faker->boolean(80)) {
             $this->seedSellerData($user);
         }
     }
     /*
     |--------------------------------------------------------------------------
     | Seed forum data
     |--------------------------------------------------------------------------
     */
     $this->call(\App\Modules\ForumModule\Database\Seeders\TagSeeder::class);
     $this->call(\App\Modules\ForumModule\Database\Seeders\PostSeeder::class);
     $this->call(\App\Modules\ForumModule\Database\Seeders\CommentSeeder::class);
     $this->call(\App\Modules\ForumModule\Database\Seeders\VoteSeeder::class);
 }