Skip to content

Commit

Permalink
Laravel 11 Support
Browse files Browse the repository at this point in the history
  • Loading branch information
erikn69 committed Feb 28, 2024
1 parent 6114e6c commit 46863f9
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@
],
"require": {
"php": "^8.0",
"illuminate/contracts": "^8.0|^9.0|^10.0",
"illuminate/support": "^8.0|^9.0|^10.0"
"illuminate/contracts": "^8.0|^9.0|^10.0|^11.0",
"illuminate/support": "^8.0|^9.0|^10.0|^11.0"
},
"require-dev": {
"phpunit/phpunit": "^9.5",
"orchestra/testbench": "^6.0|^7.0|^8.0",
"pestphp/pest": "^1.22"
"phpunit/phpunit": "^9.5|^10.5",
"orchestra/testbench": "^6.0|^7.0|^8.0|^9.0",
"pestphp/pest": "^1.22|^2.28"
},
"autoload": {
"psr-4": {
Expand Down
26 changes: 13 additions & 13 deletions tests/BladeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,43 +13,43 @@
})
->with([
'an array' => [
'parameter' => fn () => ['key' => 'value'],
'parameter' => ['key' => 'value'],
'expected' => '<script>window[\'js\'] = window[\'js\'] || {};window[\'js\'][\'key\'] = \'value\';</script>',
],
'a boolean with value of `true`' => [
'parameter' => fn () => ['boolean' => true],
'parameter' => ['boolean' => true],
'expected' => '<script>window[\'js\'] = window[\'js\'] || {};window[\'js\'][\'boolean\'] = true;</script>',
],
'a boolean with value of `false`' => [
'parameter' => fn () => ['boolean' => false],
'parameter' => ['boolean' => false],
'expected' => '<script>window[\'js\'] = window[\'js\'] || {};window[\'js\'][\'boolean\'] = false;</script>',
],
'an integer' => [
'parameter' => fn () => ['number' => 5],
'parameter' => ['number' => 5],
'expected' => '<script>window[\'js\'] = window[\'js\'] || {};window[\'js\'][\'number\'] = 5;</script>',
],
'an float' => [
'parameter' => fn () => ['number' => 5.5],
'parameter' => ['number' => 5.5],
'expected' => '<script>window[\'js\'] = window[\'js\'] || {};window[\'js\'][\'number\'] = 5.5;</script>',
],
'null' => [
'parameter' => fn () => ['nothing' => null],
'parameter' => ['nothing' => null],
'expected' => '<script>window[\'js\'] = window[\'js\'] || {};window[\'js\'][\'nothing\'] = null;</script>',
],
'a string with line breaks' => [
'parameter' => fn () => ['string' => "This is\r\n a test"],
'parameter' => ['string' => "This is\r\n a test"],
'expected' => '<script>window[\'js\'] = window[\'js\'] || {};window[\'js\'][\'string\'] = \'This is\\r\\n a test\';</script>',
],
'a numeric string as a string' => [
'parameter' => fn () => ['socialSecurity' => '123456789'],
'parameter' => ['socialSecurity' => '123456789'],
'expected' => '<script>window[\'js\'] = window[\'js\'] || {};window[\'js\'][\'socialSecurity\'] = \'123456789\';</script>',
],
'escapes tags in a string' => [
'parameter' => fn () => ['string' => "This is a <tag>"],
'parameter' => ['string' => "This is a <tag>"],
'expected' => '<script>window[\'js\'] = window[\'js\'] || {};window[\'js\'][\'string\'] = \'This is a \<tag\>\';</script>',
],
'arrayable objects' => [
'parameter' => fn () => new class () implements Arrayable {
'parameter' => new class () implements Arrayable {
public function toArray()
{
return ['arrayableKey' => 'arrayableValue'];
Expand All @@ -58,7 +58,7 @@ public function toArray()
'expected' => '<script>window[\'js\'] = window[\'js\'] || {};window[\'js\'][\'arrayableKey\'] = \'arrayableValue\';</script>',
],
'JSON serializable objects' => [
'parameter' => fn () => new class () implements JsonSerializable {
'parameter' => new class () implements JsonSerializable {
public function jsonSerialize()
{
return ['jsonKey' => 'jsonValue'];
Expand All @@ -67,7 +67,7 @@ public function jsonSerialize()
'expected' => '<script>window[\'js\'] = window[\'js\'] || {};window[\'js\'][\'0\'] = {"jsonKey":"jsonValue"};</script>',
],
'an object that implements `toJson`' => [
'parameter' => fn () => new class () {
'parameter' => new class () {
public function toJson()
{
return json_encode(['jsonKey' => 'jsonValue']);
Expand All @@ -76,7 +76,7 @@ public function toJson()
'expected' => '<script>window[\'js\'] = window[\'js\'] || {};window[\'js\'][\'0\'] = {"jsonKey":"jsonValue"};</script>',
],
'an object that implements `toString`' => [
'parameter' => fn () => new class () {
'parameter' => new class () {
public function __toString()
{
return 'string';
Expand Down

0 comments on commit 46863f9

Please sign in to comment.