Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[2.x] Adds support for Pest #866

Merged
merged 17 commits into from
Sep 8, 2021
Merged
Prev Previous commit
Next Next commit
CS
  • Loading branch information
lukeraymonddowning committed Aug 29, 2021
commit 857634a8b8b8f5d2fc69cccba94b4ec531ad1017
6 changes: 3 additions & 3 deletions stubs/pest-tests/EmailVerificationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
$response = $this->actingAs($user)->get('/email/verify');

$response->assertStatus(200);
})->skip(function() {
})->skip(function () {
return ! Features::enabled(Features::emailVerification());
}, 'Email verification not enabled.');

Expand All @@ -38,7 +38,7 @@

expect($user->fresh()->hasVerifiedEmail())->toBeTrue();
$response->assertRedirect(RouteServiceProvider::HOME.'?verified=1');
})->skip(function() {
})->skip(function () {
return ! Features::enabled(Features::emailVerification());
}, 'Email verification not enabled.');

Expand All @@ -56,6 +56,6 @@
$this->actingAs($user)->get($verificationUrl);

expect($user->fresh()->hasVerifiedEmail())->toBeFalse();
})->skip(function() {
})->skip(function () {
return ! Features::enabled(Features::emailVerification());
}, 'Email verification not enabled.');
8 changes: 4 additions & 4 deletions stubs/pest-tests/PasswordResetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
$response = $this->get('/forgot-password');

$response->assertStatus(200);
})->skip(function() {
})->skip(function () {
return ! Features::enabled(Features::updatePasswords());
}, 'Password updates are not enabled.');

Expand All @@ -23,7 +23,7 @@
]);

Notification::assertSentTo($user, ResetPassword::class);
})->skip(function() {
})->skip(function () {
return ! Features::enabled(Features::updatePasswords());
}, 'Password updates are not enabled.');

Expand All @@ -43,7 +43,7 @@

return true;
});
})->skip(function() {
})->skip(function () {
return ! Features::enabled(Features::updatePasswords());
}, 'Password updates are not enabled.');

Expand All @@ -68,6 +68,6 @@

return true;
});
})->skip(function() {
})->skip(function () {
return ! Features::enabled(Features::updatePasswords());
}, 'Password updates are not enabled.');
6 changes: 3 additions & 3 deletions stubs/pest-tests/RegistrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
$response = $this->get('/register');

$response->assertStatus(200);
})->skip(function() {
})->skip(function () {
return ! Features::enabled(Features::registration());
}, 'Registration support is not enabled.');

test('registration screen cannot be rendered if support is disabled', function () {
$response = $this->get('/register');

$response->assertStatus(404);
})->skip(function() {
})->skip(function () {
return Features::enabled(Features::registration());
}, 'Registration support is enabled.');

Expand All @@ -31,6 +31,6 @@

$this->assertAuthenticated();
$response->assertRedirect(RouteServiceProvider::HOME);
})->skip(function() {
})->skip(function () {
return ! Features::enabled(Features::registration());
}, 'Registration support is not enabled.');
2 changes: 1 addition & 1 deletion stubs/pest-tests/inertia/ApiTokenPermissionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@
->can('delete')->toBeTrue()
->can('read')->toBeFalse()
->can('missing-permission')->toBeFalse();
})->skip(function() {
})->skip(function () {
return ! Features::hasApiFeatures();
}, 'API support is not enabled.');
2 changes: 1 addition & 1 deletion stubs/pest-tests/inertia/CreateApiTokenTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@
->name->toEqual('Test Token')
->can('read')->toBeTrue()
->can('delete')->toBeFalse();
})->skip(function() {
})->skip(function () {
return ! Features::hasApiFeatures();
}, 'API support is not enabled.');
4 changes: 2 additions & 2 deletions stubs/pest-tests/inertia/DeleteAccountTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
]);

expect($user->fresh())->toBeNull();
})->skip(function() {
})->skip(function () {
return ! Features::hasAccountDeletionFeatures();
}, 'Account deletion is not enabled.');

Expand All @@ -23,6 +23,6 @@
]);

expect($user->fresh())->not->toBeNull();
})->skip(function() {
})->skip(function () {
return ! Features::hasAccountDeletionFeatures();
}, 'Account deletion is not enabled.');
2 changes: 1 addition & 1 deletion stubs/pest-tests/inertia/DeleteApiTokenTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
$response = $this->delete('/user/api-tokens/'.$token->id);

expect($user->fresh()->tokens)->toHaveCount(0);
})->skip(function() {
})->skip(function () {
return ! Features::hasApiFeatures();
}, 'API support is not enabled.');
2 changes: 1 addition & 1 deletion stubs/pest-tests/livewire/ApiTokenPermissionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@
->can('delete')->toBeTrue()
->can('read')->toBeFalse()
->can('missing-permission')->toBeFalse();
})->skip(function() {
})->skip(function () {
return ! Features::hasApiFeatures();
}, 'API support is not enabled.');
2 changes: 1 addition & 1 deletion stubs/pest-tests/livewire/CreateApiTokenTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@
->name->toEqual('Test Token')
->can('read')->toBeTrue()
->can('delete')->toBeFalse();
})->skip(function() {
})->skip(function () {
return ! Features::hasApiFeatures();
}, 'API support is not enabled.');
4 changes: 2 additions & 2 deletions stubs/pest-tests/livewire/DeleteAccountTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
->call('deleteUser');

expect($user->fresh())->toBeNull();
})->skip(function() {
})->skip(function () {
return ! Features::hasAccountDeletionFeatures();
}, 'Account deletion is not enabled.');

Expand All @@ -26,6 +26,6 @@
->assertHasErrors(['password']);

expect($user->fresh())->not->toBeNull();
})->skip(function() {
})->skip(function () {
return ! Features::hasAccountDeletionFeatures();
}, 'Account deletion is not enabled.');
2 changes: 1 addition & 1 deletion stubs/pest-tests/livewire/DeleteApiTokenTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@
->call('deleteApiToken');

expect($user->fresh()->tokens)->toHaveCount(0);
})->skip(function() {
})->skip(function () {
return ! Features::hasApiFeatures();
}, 'API support is not enabled.');