From b846d5d55359103a1826d0b806c17013422b170a Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Wed, 29 Nov 2023 18:46:33 +0000 Subject: [PATCH 1/5] Adds L11 support --- .github/workflows/tests.yml | 2 +- composer.json | 22 +++--- tests/Stubs/OutputStub.php | 144 ++++++++++++++++++++++++++---------- 3 files changed, 115 insertions(+), 53 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9515b15..813575b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -17,7 +17,7 @@ jobs: fail-fast: true matrix: php: [8.1, 8.2, 8.3] - laravel: [10] + laravel: [10, 11] name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} diff --git a/composer.json b/composer.json index 71e771f..f16d2ff 100644 --- a/composer.json +++ b/composer.json @@ -12,21 +12,21 @@ "require": { "php": "^8.1", "ext-dom": "*", - "illuminate/contracts": "^10.0", - "illuminate/database": "^10.0", - "illuminate/http": "^10.0", - "illuminate/support": "^10.0", - "illuminate/testing": "^10.0", + "illuminate/contracts": "^11.0", + "illuminate/database": "^11.0", + "illuminate/http": "^11.0", + "illuminate/support": "^11.0", + "illuminate/testing": "^11.0", "mockery/mockery": "^1.0", "phpunit/phpunit": "^10.0.7", - "symfony/console": "^6.2", - "symfony/css-selector": "^6.2", - "symfony/dom-crawler": "^6.2", - "symfony/http-foundation": "^6.2", - "symfony/http-kernel": "^6.2" + "symfony/console": "^6.2|^7.0", + "symfony/css-selector": "^6.2|^7.0", + "symfony/dom-crawler": "^6.2|^7.0", + "symfony/http-foundation": "^6.2|^7.0", + "symfony/http-kernel": "^6.2|^7.0" }, "require-dev": { - "laravel/framework": "^10.0" + "laravel/framework": "^11.0" }, "autoload": { "psr-4": { diff --git a/tests/Stubs/OutputStub.php b/tests/Stubs/OutputStub.php index 8ceaf56..bbee59d 100644 --- a/tests/Stubs/OutputStub.php +++ b/tests/Stubs/OutputStub.php @@ -2,62 +2,124 @@ namespace Laravel\BrowserKitTesting\Tests\Stubs; +use Traversable; +use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Formatter\OutputFormatterInterface; use Symfony\Component\Console\Output\OutputInterface; -class OutputStub implements OutputInterface -{ - public function write($messages, $newline = false, $options = 0) +if (property_exists(Command::class, 'defaultName')) { + class OutputStub implements OutputInterface { - } + public function write($messages, $newline = false, $options = 0) + { + } - public function writeln($messages, $options = 0) - { - } + public function writeln($messages, $options = 0) + { + } - public function setVerbosity($level) - { - } + public function setVerbosity($level) + { + } - public function getVerbosity(): int - { - return 1; - } + public function getVerbosity(): int + { + return 1; + } - public function isQuiet(): bool - { - return false; - } + public function isQuiet(): bool + { + return false; + } - public function isVerbose(): bool - { - return false; - } + public function isVerbose(): bool + { + return false; + } - public function isVeryVerbose(): bool - { - return false; - } + public function isVeryVerbose(): bool + { + return false; + } - public function isDebug(): bool - { - return false; - } + public function isDebug(): bool + { + return false; + } - public function setDecorated($decorated) - { - } + public function setDecorated($decorated) + { + } - public function isDecorated(): bool - { - return false; - } + public function isDecorated(): bool + { + return false; + } - public function setFormatter(OutputFormatterInterface $formatter) - { - } + public function setFormatter(OutputFormatterInterface $formatter) + { + } - public function getFormatter(): OutputFormatterInterface + public function getFormatter(): OutputFormatterInterface + { + } + } +} else { + class OutputStub implements OutputInterface { + public function write(Traversable|array|string $messages, bool $newline = false, int $options = 0): void + { + } + + public function writeln(Traversable|array|string $messages, int $options = 0): void + { + } + + public function setVerbosity(int $level): void + { + } + + public function getVerbosity(): int + { + return 1; + } + + public function isQuiet(): bool + { + return false; + } + + public function isVerbose(): bool + { + return false; + } + + public function isVeryVerbose(): bool + { + return false; + } + + public function isDebug(): bool + { + return false; + } + + public function setDecorated(bool $decorated): void + { + } + + public function isDecorated(): bool + { + return false; + } + + public function setFormatter(OutputFormatterInterface $formatter): void + { + } + + public function getFormatter(): OutputFormatterInterface + { + } } } + From 895b381b4e98e4bb2d5798100d8d9dce07fbea61 Mon Sep 17 00:00:00 2001 From: StyleCI Bot Date: Wed, 29 Nov 2023 18:47:07 +0000 Subject: [PATCH 2/5] Apply fixes from StyleCI --- tests/Stubs/OutputStub.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/Stubs/OutputStub.php b/tests/Stubs/OutputStub.php index bbee59d..0b1df6f 100644 --- a/tests/Stubs/OutputStub.php +++ b/tests/Stubs/OutputStub.php @@ -2,10 +2,10 @@ namespace Laravel\BrowserKitTesting\Tests\Stubs; -use Traversable; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Formatter\OutputFormatterInterface; use Symfony\Component\Console\Output\OutputInterface; +use Traversable; if (property_exists(Command::class, 'defaultName')) { class OutputStub implements OutputInterface @@ -122,4 +122,3 @@ public function getFormatter(): OutputFormatterInterface } } } - From be852bb1d46fad834f2be01d535956b522a202f0 Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Wed, 29 Nov 2023 18:49:31 +0000 Subject: [PATCH 3/5] Reverts change --- composer.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index f16d2ff..3b5c96b 100644 --- a/composer.json +++ b/composer.json @@ -12,11 +12,11 @@ "require": { "php": "^8.1", "ext-dom": "*", - "illuminate/contracts": "^11.0", - "illuminate/database": "^11.0", - "illuminate/http": "^11.0", - "illuminate/support": "^11.0", - "illuminate/testing": "^11.0", + "illuminate/contracts": "^10.0|^11.0", + "illuminate/database": "^10.0|^11.0", + "illuminate/http": "^10.0|^11.0", + "illuminate/support": "^10.0|^11.0", + "illuminate/testing": "^10.0|^11.0", "mockery/mockery": "^1.0", "phpunit/phpunit": "^10.0.7", "symfony/console": "^6.2|^7.0", From a8878c81c6bb11427ca7cc44f7483e6cdbbb521e Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Wed, 29 Nov 2023 18:50:21 +0000 Subject: [PATCH 4/5] Fixes test suite --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 3b5c96b..114c227 100644 --- a/composer.json +++ b/composer.json @@ -26,7 +26,7 @@ "symfony/http-kernel": "^6.2|^7.0" }, "require-dev": { - "laravel/framework": "^11.0" + "laravel/framework": "^10.0|^11.0" }, "autoload": { "psr-4": { From 88e3a55f78e3d07871a9915f025d47415f60e9b1 Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Wed, 29 Nov 2023 18:54:43 +0000 Subject: [PATCH 5/5] Excludes L11 on PHP 8.1 --- .github/workflows/tests.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 813575b..734288b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -18,6 +18,9 @@ jobs: matrix: php: [8.1, 8.2, 8.3] laravel: [10, 11] + exclude: + - php: 8.1 + laravel: 11 name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }}