Satisfy Pint on the two new guard-boundary tests

Import the classes instead of referencing them fully-qualified, and
use single quotes where no interpolation or escaping is needed.
feat/operator-identity
nexxo 2026-07-28 15:10:58 +02:00
parent 055c6228f4
commit 9c851b28b4
2 changed files with 4 additions and 3 deletions

View File

@ -1,6 +1,7 @@
<?php <?php
use App\Livewire\Admin\Secrets; use App\Livewire\Admin\Secrets;
use App\Livewire\Settings;
use App\Models\Operator; use App\Models\Operator;
use App\Models\User; use App\Models\User;
use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Auth;
@ -34,7 +35,7 @@ it('rejects a password that belongs to a portal user with the same address', fun
it('still confirms a portal password on the web guard', function () { it('still confirms a portal password on the web guard', function () {
$user = User::factory()->create(['password' => 'kunden-passwort']); $user = User::factory()->create(['password' => 'kunden-passwort']);
Livewire::actingAs($user)->test(App\Livewire\Settings::class) Livewire::actingAs($user)->test(Settings::class)
->set('confirmablePassword', 'kunden-passwort') ->set('confirmablePassword', 'kunden-passwort')
->call('confirmPassword') ->call('confirmPassword')
->assertHasNoErrors(); ->assertHasNoErrors();
@ -112,7 +113,7 @@ it("does not let a portal customer's password confirmation satisfy the console's
// App\Livewire\Settings::confirmationGuard() defaults to 'web', resolved // App\Livewire\Settings::confirmationGuard() defaults to 'web', resolved
// explicitly by guard — no actingAs needed to reach the right account, // explicitly by guard — no actingAs needed to reach the right account,
// the login() call above already put it in the session. // the login() call above already put it in the session.
Livewire::test(App\Livewire\Settings::class) Livewire::test(Settings::class)
->set('confirmablePassword', 'kunden-passwort') ->set('confirmablePassword', 'kunden-passwort')
->call('confirmPassword') ->call('confirmPassword')
->assertHasNoErrors(); ->assertHasNoErrors();

View File

@ -15,7 +15,7 @@ use Illuminate\Support\Facades\Auth;
* silently signed an operator elsewhere in that same browser out of the * silently signed an operator elsewhere in that same browser out of the
* console too. * console too.
*/ */
it("suspending a portal customer does not sign an operator out of a console session sharing the same browser", function () { it('suspending a portal customer does not sign an operator out of a console session sharing the same browser', function () {
$operator = Operator::factory()->role('Owner')->create(); $operator = Operator::factory()->role('Owner')->create();
$user = User::factory()->create(); $user = User::factory()->create();
Customer::factory()->create(['email' => $user->email, 'user_id' => $user->id, 'status' => 'suspended']); Customer::factory()->create(['email' => $user->email, 'user_id' => $user->id, 'status' => 'suspended']);