Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Mar 29, 2021
1 parent e73e184 commit e0a9d2e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
5 changes: 5 additions & 0 deletions database/factories/UserFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use App\Models\User;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;
use Laravel\Jetstream\Features;

class UserFactory extends Factory
{
Expand Down Expand Up @@ -53,6 +54,10 @@ public function unverified()
*/
public function withPersonalTeam()

This comment has been minimized.

Copy link
@bdsumon4u

bdsumon4u Apr 11, 2021

This file is published when Jetstream's team feature is enabled.
If team feature is disabled, Laravel's default UserFactory doesn't have this method. In that case, if email verification is enabled then EmailVerificationTest fails.

{
if (! Features::hasTeamFeatures()) {
return $this->state([]);
}

return $this->has(
Team::factory()
->state(function (array $attributes, User $user) {
Expand Down
12 changes: 3 additions & 9 deletions stubs/tests/EmailVerificationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,9 @@ public function test_email_verification_screen_can_be_rendered()
return $this->markTestSkipped('Email verification not enabled.');
}

if (JetstreamFeatures::hasTeamFeatures()) {
$user = User::factory()->withPersonalTeam()->create([
'email_verified_at' => null,
]);
} else {
$user = User::factory()->create([
'email_verified_at' => null,
]);
}
$user = User::factory()->withPersonalTeam()->create([

This comment has been minimized.

Copy link
@bdsumon4u

bdsumon4u Apr 11, 2021

What if, team feature is disabled & email verification is enabled!
In default laravel, UserFactory doesn't have withPersonalTeam method.

'email_verified_at' => null,
]);

$response = $this->actingAs($user)->get('/email/verify');

Expand Down

1 comment on commit e0a9d2e

@bjuppa
Copy link
Contributor

@bjuppa bjuppa commented on e0a9d2e Mar 31, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems this one overwrites the main part of https://github.com/laravel/jetstream/pull/737/files that was merged just before it. Was it intentional?

Please sign in to comment.