Skip to content

Commit

Permalink
Fix factories
Browse files Browse the repository at this point in the history
  • Loading branch information
driesvints committed Aug 25, 2020
1 parent 421b38a commit 40956f1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 4 additions & 3 deletions tests/Feature/AccessTokenControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Illuminate\Support\Facades\Schema;
use Laravel\Passport\Client;
use Laravel\Passport\ClientRepository;
use Laravel\Passport\Database\Factories\ClientFactory;
use Laravel\Passport\HasApiTokens;
use Laravel\Passport\Token;
use Laravel\Passport\TokenRepository;
Expand Down Expand Up @@ -51,7 +52,7 @@ public function testGettingAccessTokenWithPasswordGrant()
$user->save();

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

$response = $this->post(
'/oauth/token',
Expand Down Expand Up @@ -102,7 +103,7 @@ public function testGettingAccessTokenWithPasswordGrantWithInvalidPassword()
$user->save();

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

$response = $this->post(
'/oauth/token',
Expand Down Expand Up @@ -145,7 +146,7 @@ public function testGettingAccessTokenWithPasswordGrantWithInvalidClientSecret()
$user->save();

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

$response = $this->post(
'/oauth/token',
Expand Down
2 changes: 0 additions & 2 deletions tests/Feature/PassportTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ protected function setUp(): void
{
parent::setUp();

$this->withFactories(__DIR__.'/../../database/factories');

$this->artisan('migrate:fresh');

Passport::routes();
Expand Down

0 comments on commit 40956f1

Please sign in to comment.