Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ jobs:
matrix:
php: [8.2, 8.3, 8.4]
laravel: [11, 12]
include:
- php: 8.5
laravel: 12

name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }}

Expand Down
5 changes: 2 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@
},
"require-dev": {
"mockery/mockery": "^1.6",
"orchestra/testbench": "^9.0|^10.0",
"phpstan/phpstan": "^1.10",
"phpunit/phpunit": "^11.3"
"orchestra/testbench": "^9.15|^10.8",
"phpstan/phpstan": "^1.10"
},
"autoload": {
"psr-4": {
Expand Down
5 changes: 2 additions & 3 deletions tests/Controller/AuthenticateRequestsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Laravel\Sanctum\Sanctum;
use Orchestra\Testbench\Concerns\WithWorkbench;
use Orchestra\Testbench\TestCase;
use PHPUnit\Framework\Attributes\DataProvider;
use Workbench\App\Models\User;
use Workbench\Database\Factories\PersonalAccessTokenFactory;
use Workbench\Database\Factories\UserFactory;
Expand Down Expand Up @@ -56,9 +57,7 @@ public function test_can_authorize_valid_user_using_authorization_header()
->assertSee($user->email);
}

/**
* @dataProvider sanctumGuardsDataProvider
*/
#[DataProvider('sanctumGuardsDataProvider')]
public function test_can_authorize_valid_user_using_sanctum_acting_as($guard)
{
PersonalAccessTokenFactory::new()->for(
Expand Down
5 changes: 2 additions & 3 deletions tests/Controller/FrontendRequestsAreStatefulTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Laravel\Sanctum\Sanctum;
use Orchestra\Testbench\Concerns\WithWorkbench;
use Orchestra\Testbench\TestCase;
use PHPUnit\Framework\Attributes\DataProvider;
use Workbench\App\Models\User;
use Workbench\Database\Factories\UserFactory;

Expand Down Expand Up @@ -97,9 +98,7 @@ public function test_middleware_keeps_session_logged_in_when_sanctum_request_cha
->assertSee($user->email);
}

/**
* @dataProvider sanctumGuardsDataProvider
*/
#[DataProvider('sanctumGuardsDataProvider')]
public function test_middleware_can_deauthorize_valid_user_using_acting_as_after_password_change_from_sanctum_guard($guard)
{
$user = UserFactory::new()->create();
Expand Down
5 changes: 2 additions & 3 deletions tests/Feature/GuardTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use Mockery;
use Orchestra\Testbench\Concerns\WithWorkbench;
use Orchestra\Testbench\TestCase;
use PHPUnit\Framework\Attributes\DataProvider;
use stdClass;
use Workbench\App\Models\User;
use Workbench\Database\Factories\PersonalAccessTokenFactory;
Expand Down Expand Up @@ -221,9 +222,7 @@ public function test_authentication_with_token_fails_if_user_provider_is_invalid
Event::assertNotDispatched(TokenAuthenticated::class);
}

/**
* @dataProvider invalidTokenDataProvider
*/
#[DataProvider('invalidTokenDataProvider')]
public function test_authentication_with_token_fails_if_token_has_invalid_format($invalidToken)
{
$factory = Mockery::mock(AuthFactory::class);
Expand Down