Skip to content

Commit 124b539

Browse files
committed
Initial changes to support Laravel 11
1 parent 0b3ae3f commit 124b539

17 files changed

+60
-54
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ jobs:
2121
matrix:
2222
os: [ubuntu-latest, windows-latest]
2323
php: [8.3, 8.4]
24-
laravel: ["10.*"]
24+
laravel: ["11.*"]
2525
stability: [prefer-lowest, prefer-stable]
2626
include:
27-
- laravel: 10.*
28-
testbench: 8.*
27+
- laravel: 11.*
28+
testbench: 9.*
2929
carbon: ^2.63
3030

3131
steps:

composer.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@
1818
],
1919
"require": {
2020
"php": "^8.2",
21-
"illuminate/auth": "^10.0",
22-
"illuminate/console": "^10.0",
23-
"illuminate/encryption": "^10.0",
24-
"illuminate/support": "^10.0",
25-
"illuminate/view": "^10.0",
21+
"illuminate/auth": "^11.0",
22+
"illuminate/console": "^11.0",
23+
"illuminate/encryption": "^11.0",
24+
"illuminate/support": "^11.0",
25+
"illuminate/view": "^11.0",
2626
"laravel/socialite": "^5.0",
2727
"socialiteproviders/gitlab": "^4.0",
2828
"socialiteproviders/dropbox": "^4.1"
@@ -33,7 +33,7 @@
3333
"larastan/larastan": "^2.9",
3434
"mockery/mockery": "^1.4.4",
3535
"phpunit/phpunit": "^10.5",
36-
"orchestra/testbench": "^8.22"
36+
"orchestra/testbench": "^9.9"
3737
},
3838
"autoload": {
3939
"psr-4": {

src/Console/Commands/ScaffoldAuthenticationControllers.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ protected function identifyApplicationNamespace()
9797
$this->comment("Using [$this->namespace] as application namespace.");
9898
}
9999

100-
$this->modelNamespace = is_dir(app_path('Models')) ? $this->namespace.'\\Models' : $this->namespace;
100+
$this->modelNamespace = is_dir(app_path('Models')) ? $this->namespace.'\Models' : $this->namespace;
101101
} catch (RuntimeException $ex) {
102102
$this->warn("Unable to identity the application namespace, assuming [$this->namespace].");
103103
}

tests/TestCase.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ protected function defineEnvironment($app)
5959
'database' => ':memory:',
6060
'prefix' => '',
6161
]);
62+
config()->set('session.driver', 'array');
6263
config()->set('services.gitlab', [
6364
'client_id' => 'aaa',
6465
'client_secret' => 'bbb',

tests/Unit/ConnectControllerTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,14 @@
99
use Mockery;
1010
use Oneofftech\Identities\Facades\Identity as IdentityFacade;
1111
use Oneofftech\Identities\Facades\IdentityCrypt;
12+
use Orchestra\Testbench\Attributes\WithMigration;
1213
use SocialiteProviders\GitLab\Provider;
1314
use SocialiteProviders\Manager\OAuth2\User as OauthUser;
1415
use Tests\Fixtures\Concern\UseTestFixtures;
1516
use Tests\Fixtures\User;
1617
use Tests\TestCase;
1718

19+
#[WithMigration]
1820
class ConnectControllerTest extends TestCase
1921
{
2022
use RefreshDatabase, UseTestFixtures;

tests/Unit/IdentityLinkTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
class IdentityLinkTest extends TestCase
1313
{
14-
use DatabaseMigrations;
1514

1615
protected function setUp(): void
1716
{

tests/Unit/IdentityModelsConfigurationTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
class IdentityModelsConfigurationTest extends TestCase
1212
{
13-
use DatabaseMigrations;
1413

1514
public function test_default_models_uses_app_namespace()
1615
{

tests/Unit/IdentityServiceProviderTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,23 @@
33
namespace Tests\Unit;
44

55
use Illuminate\Foundation\Testing\DatabaseMigrations;
6+
use Illuminate\Foundation\Testing\RefreshDatabase;
67
use InvalidArgumentException;
78
use Laravel\Socialite\Two\FacebookProvider;
89
use Oneofftech\Identities\Facades\Identity;
910
use Oneofftech\Identities\IdentitiesManager;
1011
use Oneofftech\Identities\Providers\IdentitiesServiceProvider;
12+
use Orchestra\Testbench\Attributes\WithMigration;
1113
use SocialiteProviders\Dropbox\Provider as DropboxDriver;
1214
use SocialiteProviders\GitLab\GitLabExtendSocialite;
1315
use SocialiteProviders\GitLab\Provider as GitlabSocialiteProvider;
1416
use SocialiteProviders\Manager\SocialiteWasCalled;
1517
use Tests\TestCase;
1618

19+
#[WithMigration]
1720
class IdentityServiceProviderTest extends TestCase
1821
{
19-
use DatabaseMigrations;
22+
use RefreshDatabase;
2023

2124
public function test_default_driver_cannot_not_configured()
2225
{

tests/Unit/IdentityTraitTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@
88
use Oneofftech\Identities\Facades\Identity as IdentityFacade;
99
use Oneofftech\Identities\Facades\IdentityCrypt;
1010
use Oneofftech\Identities\Support\FindIdentity;
11+
use Orchestra\Testbench\Attributes\WithMigration;
1112
use Tests\Fixtures\Identity;
1213
use Tests\Fixtures\User;
1314
use Tests\TestCase;
1415

16+
#[WithMigration]
1517
class IdentityTraitTest extends TestCase
1618
{
1719
use FindIdentity, RefreshDatabase;

tests/Unit/InteractWithPreviousUrlTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,19 @@ class InteractWithPreviousUrlTest extends TestCase
1212

1313
public function test_previous_url_is_stored()
1414
{
15-
Session::shouldReceive('previousUrl')->andReturn('http://localhost/previous');
16-
17-
Session::shouldReceive('put')->once()->with('_oot.identities.previous_url', 'http://localhost/previous');
15+
Session::put('_previous.url', 'http://localhost/previous');
1816

1917
$this->savePreviousUrl();
18+
19+
$this->assertEquals('http://localhost/previous', Session::get('_oot.identities.previous_url'));
2020
}
2121

2222
public function test_previous_url_can_be_retrieved()
2323
{
24-
Session::shouldReceive('previousUrl')->andReturnNull();
25-
26-
Session::shouldReceive('pull')->once()->with('_oot.identities.previous_url', 'http://localhost')->andReturn('http://localhost/previous');
24+
Session::put('_previous.url', null);
2725

26+
Session::put('_oot.identities.previous_url', 'http://localhost/previous');
27+
2828
$url = $this->getPreviousUrl();
2929

3030
$this->assertEquals('http://localhost/previous', $url);

0 commit comments

Comments
 (0)