Skip to content

Commit 40956f1

Browse files
committed
Fix factories
1 parent 421b38a commit 40956f1

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

tests/Feature/AccessTokenControllerTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use Illuminate\Support\Facades\Schema;
99
use Laravel\Passport\Client;
1010
use Laravel\Passport\ClientRepository;
11+
use Laravel\Passport\Database\Factories\ClientFactory;
1112
use Laravel\Passport\HasApiTokens;
1213
use Laravel\Passport\Token;
1314
use Laravel\Passport\TokenRepository;
@@ -51,7 +52,7 @@ public function testGettingAccessTokenWithPasswordGrant()
5152
$user->save();
5253

5354
/** @var Client $client */
54-
$client = Client::factory()->asPasswordClient()->create(['user_id' => $user->id]);
55+
$client = ClientFactory::new()->asPasswordClient()->create(['user_id' => $user->id]);
5556

5657
$response = $this->post(
5758
'/oauth/token',
@@ -102,7 +103,7 @@ public function testGettingAccessTokenWithPasswordGrantWithInvalidPassword()
102103
$user->save();
103104

104105
/** @var Client $client */
105-
$client = Client::factory()->asPasswordClient()->create(['user_id' => $user->id]);
106+
$client = ClientFactory::new()->asPasswordClient()->create(['user_id' => $user->id]);
106107

107108
$response = $this->post(
108109
'/oauth/token',
@@ -145,7 +146,7 @@ public function testGettingAccessTokenWithPasswordGrantWithInvalidClientSecret()
145146
$user->save();
146147

147148
/** @var Client $client */
148-
$client = Client::factory()->asPasswordClient()->create(['user_id' => $user->id]);
149+
$client = ClientFactory::new()->asPasswordClient()->create(['user_id' => $user->id]);
149150

150151
$response = $this->post(
151152
'/oauth/token',

tests/Feature/PassportTestCase.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ protected function setUp(): void
2020
{
2121
parent::setUp();
2222

23-
$this->withFactories(__DIR__.'/../../database/factories');
24-
2523
$this->artisan('migrate:fresh');
2624

2725
Passport::routes();

0 commit comments

Comments
 (0)