Skip to content

Commit

Permalink
Merge pull request #709 from shuvroroy/main
Browse files Browse the repository at this point in the history
Add support for laravel 11
  • Loading branch information
bakerkretzmar committed Feb 20, 2024
2 parents 4995308 + 78b1011 commit 6367054
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 13 deletions.
28 changes: 26 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,21 @@ jobs:
strategy:
matrix:
os: [[Ubuntu, ubuntu-latest], [Windows, windows-latest]]
php: ['7.3', '7.4', '8.0', '8.1', '8.2']
laravel: [5.5.*, 5.6.*, 5.7.*, 5.8.*, 6.*, 7.*, 8.*, 9.*, 10.*]
php: ['7.3', '7.4', '8.0', '8.1', '8.2', '8.3']
laravel: [5.5.*, 5.6.*, 5.7.*, 5.8.*, 6.*, 7.*, 8.*, 9.*, 10.*, 11.*]
exclude:
- php: '7.3'
laravel: 9.*
- php: '7.3'
laravel: 10.*
- php: '7.3'
laravel: 11.*
- php: '7.4'
laravel: 9.*
- php: '7.4'
laravel: 10.*
- php: '7.4'
laravel: 11.*
- php: '8.0'
laravel: 5.5.*
- php: '8.0'
Expand All @@ -34,6 +38,8 @@ jobs:
laravel: 5.8.*
- php: '8.0'
laravel: 10.*
- php: '8.0'
laravel: 11.*
- php: '8.1'
laravel: 5.5.*
- php: '8.1'
Expand All @@ -46,6 +52,8 @@ jobs:
laravel: 6.*
- php: '8.1'
laravel: 7.*
- php: '8.1'
laravel: 11.*
- php: '8.2'
laravel: 5.5.*
- php: '8.2'
Expand All @@ -58,6 +66,22 @@ jobs:
laravel: 6.*
- php: '8.2'
laravel: 7.*
- php: '8.3'
laravel: 5.5.*
- php: '8.3'
laravel: 5.6.*
- php: '8.3'
laravel: 5.7.*
- php: '8.3'
laravel: 5.8.*
- php: '8.3'
laravel: 6.*
- php: '8.3'
laravel: 7.*
- php: '8.3'
laravel: 8.*
- php: '8.3'
laravel: 9.*
steps:
- uses: actions/checkout@v3
- uses: shivammathur/setup-php@v2
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
"laravel/framework": ">=5.4@dev"
},
"require-dev": {
"orchestra/testbench": "^3.0 || ^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0",
"phpunit/phpunit": "^6.0 || ^7.0 || ^8.0 || ^9.0"
"orchestra/testbench": "^3.0 || ^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0",
"phpunit/phpunit": "^6.0 || ^7.0 || ^8.0 || ^9.0 || ^10.0"
},
"autoload": {
"psr-4": {
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

class TestCase extends OrchestraTestCase
{
public static function assertStringContainsString(string $needle, string $haystack, string $message = ''): void
public static function assertContainsString(string $needle, string $haystack, string $message = ''): void
{
$constraint = new StringContains($needle, false);

Expand Down
8 changes: 4 additions & 4 deletions tests/Unit/BladeRouteGeneratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public function can_resolve_generator_from_container()
{
$generator = app(BladeRouteGenerator::class);

$this->assertStringContainsString('"routes":[]', $generator->generate());
$this->assertContainsString('"routes":[]', $generator->generate());
}

/** @test */
Expand Down Expand Up @@ -73,7 +73,7 @@ public function can_generate_routes_for_default_domain()
],
];

$this->assertStringContainsString(json_encode($expected), (new BladeRouteGenerator)->generate());
$this->assertContainsString(json_encode($expected), (new BladeRouteGenerator)->generate());
}

/** @test */
Expand All @@ -94,7 +94,7 @@ public function can_generate_routes_for_custom_domain()
],
];

$this->assertStringContainsString(json_encode($expected), (new BladeRouteGenerator)->generate());
$this->assertContainsString(json_encode($expected), (new BladeRouteGenerator)->generate());
}

/** @test */
Expand Down Expand Up @@ -132,7 +132,7 @@ public function can_generate_routes_for_given_group_or_groups()
/** @test */
public function can_set_csp_nonce()
{
$this->assertStringContainsString(
$this->assertContainsString(
'<script type="text/javascript" nonce="supercalifragilisticexpialidocious">',
(new BladeRouteGenerator)->generate(false, 'supercalifragilisticexpialidocious')
);
Expand Down
20 changes: 16 additions & 4 deletions tests/Unit/CommandRouteGeneratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ public function can_generate_dts_file()
/** @test */
public function can_generate_dts_file_with_scoped_bindings()
{
if (! $this->laravelVersion(7)) {
if (!$this->laravelVersion(7)) {
$this->markTestSkipped('Requires Laravel >=7');
}

Expand Down Expand Up @@ -197,7 +197,13 @@ public function can_generate_dts_file_without_routes()
Artisan::call('ziggy:generate', ['--types-only' => true]);

$this->assertFileExists(base_path('resources/js/ziggy.d.ts'));
$this->assertFileNotExists(base_path('resources/js/ziggy.js'));


if (method_exists($this, 'assertFileDoesNotExist')) {
$this->assertFileDoesNotExist(base_path('resources/js/ziggy.js'));
} else {
$this->assertFileNotExists(base_path('resources/js/ziggy.js'));
}
}

/** @test */
Expand All @@ -211,7 +217,12 @@ public function can_derive_dts_file_path_from_given_path()
Artisan::call('ziggy:generate', ['--types-only' => true]);

$this->assertFileExists(base_path('resources/js/custom.d.ts'));
$this->assertFileNotExists(base_path('resources/js/ziggy.d.ts'));

if (method_exists($this, 'assertFileDoesNotExist')) {
$this->assertFileDoesNotExist(base_path('resources/js/ziggy.d.ts'));
} else {
$this->assertFileNotExists(base_path('resources/js/ziggy.d.ts'));
}
}

/** @test */
Expand Down Expand Up @@ -275,7 +286,8 @@ public function __toString(): string

class PostCommentController
{
public function __invoke($post, $comment) {
public function __invoke($post, $comment)
{
//
}
}

0 comments on commit 6367054

Please sign in to comment.