Skip to content

Commit 445b14d

Browse files
committed
Laravel 11 Support
1 parent 6114e6c commit 445b14d

File tree

3 files changed

+24
-18
lines changed

3 files changed

+24
-18
lines changed

.github/workflows/run-tests.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,19 @@ jobs:
1313
laravel: [10.*, 9.*, 8.*]
1414
dependency-version: [prefer-stable]
1515
include:
16+
- laravel: 11.*
17+
testbench: 9.*
1618
- laravel: 10.*
1719
testbench: 8.*
1820
- laravel: 9.*
1921
testbench: 7.*
2022
- laravel: 8.*
2123
testbench: 6.*
2224
exclude:
25+
- laravel: 11.*
26+
php: 8.1
27+
- laravel: 11.*
28+
php: 8.0
2329
- laravel: 10.*
2430
php: 8.0
2531

composer.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@
2727
],
2828
"require": {
2929
"php": "^8.0",
30-
"illuminate/contracts": "^8.0|^9.0|^10.0",
31-
"illuminate/support": "^8.0|^9.0|^10.0"
30+
"illuminate/contracts": "^8.0|^9.0|^10.0|^11.0",
31+
"illuminate/support": "^8.0|^9.0|^10.0|^11.0"
3232
},
3333
"require-dev": {
34-
"phpunit/phpunit": "^9.5",
35-
"orchestra/testbench": "^6.0|^7.0|^8.0",
36-
"pestphp/pest": "^1.22"
34+
"phpunit/phpunit": "^9.5|^10.5",
35+
"orchestra/testbench": "^6.0|^7.0|^8.0|^9.0",
36+
"pestphp/pest": "^1.22|^2.28"
3737
},
3838
"autoload": {
3939
"psr-4": {

tests/BladeTest.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,43 +13,43 @@
1313
})
1414
->with([
1515
'an array' => [
16-
'parameter' => fn () => ['key' => 'value'],
16+
'parameter' => ['key' => 'value'],
1717
'expected' => '<script>window[\'js\'] = window[\'js\'] || {};window[\'js\'][\'key\'] = \'value\';</script>',
1818
],
1919
'a boolean with value of `true`' => [
20-
'parameter' => fn () => ['boolean' => true],
20+
'parameter' => ['boolean' => true],
2121
'expected' => '<script>window[\'js\'] = window[\'js\'] || {};window[\'js\'][\'boolean\'] = true;</script>',
2222
],
2323
'a boolean with value of `false`' => [
24-
'parameter' => fn () => ['boolean' => false],
24+
'parameter' => ['boolean' => false],
2525
'expected' => '<script>window[\'js\'] = window[\'js\'] || {};window[\'js\'][\'boolean\'] = false;</script>',
2626
],
2727
'an integer' => [
28-
'parameter' => fn () => ['number' => 5],
28+
'parameter' => ['number' => 5],
2929
'expected' => '<script>window[\'js\'] = window[\'js\'] || {};window[\'js\'][\'number\'] = 5;</script>',
3030
],
3131
'an float' => [
32-
'parameter' => fn () => ['number' => 5.5],
32+
'parameter' => ['number' => 5.5],
3333
'expected' => '<script>window[\'js\'] = window[\'js\'] || {};window[\'js\'][\'number\'] = 5.5;</script>',
3434
],
3535
'null' => [
36-
'parameter' => fn () => ['nothing' => null],
36+
'parameter' => ['nothing' => null],
3737
'expected' => '<script>window[\'js\'] = window[\'js\'] || {};window[\'js\'][\'nothing\'] = null;</script>',
3838
],
3939
'a string with line breaks' => [
40-
'parameter' => fn () => ['string' => "This is\r\n a test"],
40+
'parameter' => ['string' => "This is\r\n a test"],
4141
'expected' => '<script>window[\'js\'] = window[\'js\'] || {};window[\'js\'][\'string\'] = \'This is\\r\\n a test\';</script>',
4242
],
4343
'a numeric string as a string' => [
44-
'parameter' => fn () => ['socialSecurity' => '123456789'],
44+
'parameter' => ['socialSecurity' => '123456789'],
4545
'expected' => '<script>window[\'js\'] = window[\'js\'] || {};window[\'js\'][\'socialSecurity\'] = \'123456789\';</script>',
4646
],
4747
'escapes tags in a string' => [
48-
'parameter' => fn () => ['string' => "This is a <tag>"],
48+
'parameter' => ['string' => "This is a <tag>"],
4949
'expected' => '<script>window[\'js\'] = window[\'js\'] || {};window[\'js\'][\'string\'] = \'This is a \<tag\>\';</script>',
5050
],
5151
'arrayable objects' => [
52-
'parameter' => fn () => new class () implements Arrayable {
52+
'parameter' => new class () implements Arrayable {
5353
public function toArray()
5454
{
5555
return ['arrayableKey' => 'arrayableValue'];
@@ -58,7 +58,7 @@ public function toArray()
5858
'expected' => '<script>window[\'js\'] = window[\'js\'] || {};window[\'js\'][\'arrayableKey\'] = \'arrayableValue\';</script>',
5959
],
6060
'JSON serializable objects' => [
61-
'parameter' => fn () => new class () implements JsonSerializable {
61+
'parameter' => new class () implements JsonSerializable {
6262
public function jsonSerialize()
6363
{
6464
return ['jsonKey' => 'jsonValue'];
@@ -67,7 +67,7 @@ public function jsonSerialize()
6767
'expected' => '<script>window[\'js\'] = window[\'js\'] || {};window[\'js\'][\'0\'] = {"jsonKey":"jsonValue"};</script>',
6868
],
6969
'an object that implements `toJson`' => [
70-
'parameter' => fn () => new class () {
70+
'parameter' => new class () {
7171
public function toJson()
7272
{
7373
return json_encode(['jsonKey' => 'jsonValue']);
@@ -76,7 +76,7 @@ public function toJson()
7676
'expected' => '<script>window[\'js\'] = window[\'js\'] || {};window[\'js\'][\'0\'] = {"jsonKey":"jsonValue"};</script>',
7777
],
7878
'an object that implements `toString`' => [
79-
'parameter' => fn () => new class () {
79+
'parameter' => new class () {
8080
public function __toString()
8181
{
8282
return 'string';

0 commit comments

Comments
 (0)