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

add laravel 11 to workflow run tests #2605

Merged
merged 5 commits into from
Feb 28, 2024
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 7 additions & 1 deletion .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,22 @@ jobs:
fail-fast: false
matrix:
php: [8.3, 8.2, 8.1, 8.0]
laravel: ["^10.0", "^9.0", "^8.12"]
laravel: ["^11.0", "^10.0", "^9.0", "^8.12"]
dependency-version: [prefer-lowest, prefer-stable]
include:
- laravel: "^11.0"
testbench: 9.*
- laravel: "^10.0"
testbench: 8.*
- laravel: "^9.0"
testbench: 7.*
- laravel: "^8.12"
testbench: "^6.23"
exclude:
- laravel: "^11.0"
php: 8.1
drbyte marked this conversation as resolved.
Show resolved Hide resolved
- laravel: "^11.0"
php: 8.0
- laravel: "^10.0"
php: 8.0
- laravel: "^8.12"
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"illuminate/database": "^8.12|^9.0|^10.0|^11.0"
},
"require-dev": {
"laravel/passport": "^11.0",
"laravel/passport": "^11.0|^12.0",
"orchestra/testbench": "^6.23|^7.0|^8.0|^9.0",
"phpunit/phpunit": "^9.4|^10.1"
},
Expand Down
4 changes: 2 additions & 2 deletions src/Guard.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class Guard
* Return a collection of guard names suitable for the $model,
* as indicated by the presence of a $guard_name property or a guardName() method on the model.
*
* @param string|Model $model model class object or name
* @param string|Model $model model class object or name
*/
public static function getNames($model): Collection
{
Expand Down Expand Up @@ -58,7 +58,7 @@ protected static function getConfigAuthGuards(string $class): Collection
/**
* Lookup a guard name relevant for the $class model and the current user.
*
* @param string|Model $class model class object or name
* @param string|Model $class model class object or name
* @return string guard name
*/
public static function getDefaultName($class): string
Expand Down
8 changes: 6 additions & 2 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,12 @@ protected function setUpPassport($app): void
$app['config']->set('permission.use_passport_client_credentials', true);
$app['config']->set('auth.guards.api', ['driver' => 'passport', 'provider' => 'users']);

$this->artisan('migrate');
$this->artisan('passport:install');
// mimic passport:install (must load migrations using our own call to loadMigrationsFrom() else rollbacks won't occur, and migrations will be left in skeleton directory
$this->artisan('passport:keys');
$this->loadMigrationsFrom(__DIR__.'/../vendor/laravel/passport/database/migrations/');
$provider = in_array('users', array_keys(config('auth.providers'))) ? 'users' : null;
$this->artisan('passport:client', ['--personal' => true, '--name' => config('app.name').' Personal Access Client']);
$this->artisan('passport:client', ['--password' => true, '--name' => config('app.name').' Password Grant Client', '--provider' => $provider]);

$this->testClient = Client::create(['name' => 'Test', 'redirect' => 'https://example.com', 'personal_access_client' => 0, 'password_client' => 0, 'revoked' => 0]);
$this->testClientRole = $app[Role::class]->create(['name' => 'clientRole', 'guard_name' => 'api']);
Expand Down