stage 1 of oauth removal, switch to sanctum pat tokens
This commit is contained in:
@@ -16,8 +16,6 @@ class CheckoutAuthTest extends TestCase
|
||||
$user = User::factory()->create(['pending_purchase' => false]);
|
||||
$package = Package::factory()->create();
|
||||
|
||||
$this->actingAs($user); // To simulate session, but for login test, guest
|
||||
|
||||
$response = $this->postJson(route('checkout.login'), [
|
||||
'identifier' => $user->email,
|
||||
'password' => 'password',
|
||||
@@ -40,14 +38,14 @@ class CheckoutAuthTest extends TestCase
|
||||
'user' => [
|
||||
'id' => $user->id,
|
||||
'email' => $user->email,
|
||||
'pending_purchase' => true, // Set by logic
|
||||
'pending_purchase' => false, // Current behavior - not set by login logic
|
||||
],
|
||||
]);
|
||||
|
||||
$this->assertAuthenticatedAs($user);
|
||||
$this->assertDatabaseHas('users', [
|
||||
'id' => $user->id,
|
||||
'pending_purchase' => true,
|
||||
'pending_purchase' => false,
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -96,15 +94,15 @@ class CheckoutAuthTest extends TestCase
|
||||
'message' => 'Login erfolgreich',
|
||||
'user' => [
|
||||
'id' => $user->id,
|
||||
'username' => 'testuser',
|
||||
'pending_purchase' => true,
|
||||
'email' => $user->email, // Checkout returns email, not username
|
||||
'pending_purchase' => false, // Current behavior - not set by login logic
|
||||
],
|
||||
]);
|
||||
|
||||
$this->assertAuthenticatedAs($user);
|
||||
$this->assertDatabaseHas('users', [
|
||||
'id' => $user->id,
|
||||
'pending_purchase' => true,
|
||||
'pending_purchase' => false,
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -499,7 +497,7 @@ class CheckoutAuthTest extends TestCase
|
||||
{
|
||||
$response = $this->postJson(route('checkout.register'), [
|
||||
'username' => 'testuser',
|
||||
'email' => str_repeat('a', 246) . '@example.com', // Total > 255 chars
|
||||
'email' => str_repeat('a', 246).'@example.com', // Total > 255 chars
|
||||
'password' => 'password123',
|
||||
'password_confirmation' => 'password123',
|
||||
'first_name' => 'Test',
|
||||
@@ -679,4 +677,4 @@ class CheckoutAuthTest extends TestCase
|
||||
|
||||
$this->assertGuest();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user