From d1e9d5709dcb6f7637ab0a64eb3d65dd6cd6c4e9 Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Wed, 26 Jul 2023 06:27:08 +0800 Subject: [PATCH 01/11] wip --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 6a11f6ab..db0c1185 100644 --- a/composer.json +++ b/composer.json @@ -37,7 +37,7 @@ "php": "^8.1", "composer-runtime-api": "^2.2", "konsulting/project-root": "^1.1", - "laravel/dusk": "^7.8", + "laravel/dusk": "^7.9", "laravel/serializable-closure": "^1.0", "orchestra/dusk-updater": "^2.2", "orchestra/testbench": ">=8.5.7 <8.6.0", From 8a5d02cd1d92915504a1a64f542259c975857f92 Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Tue, 8 Aug 2023 08:04:50 +0800 Subject: [PATCH 02/11] wip Signed-off-by: Mior Muhammad Zaki --- composer.json | 2 +- testbench-dusk | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 84cfb2fd..cceaf9db 100644 --- a/composer.json +++ b/composer.json @@ -40,7 +40,7 @@ "opis/closure": "^3.6", "laravel/serializable-closure": "^1.0", "orchestra/dusk-updater": "^1.7 || ^2.2", - "orchestra/testbench": "^6.28", + "orchestra/testbench": "^6.29", "php-webdriver/webdriver": "^1.9" }, "require-dev": { diff --git a/testbench-dusk b/testbench-dusk index 840a4a9a..77ab374e 100755 --- a/testbench-dusk +++ b/testbench-dusk @@ -1,6 +1,8 @@ #!/usr/bin/env php Date: Tue, 8 Aug 2023 08:51:13 +0800 Subject: [PATCH 03/11] wip Signed-off-by: Mior Muhammad Zaki --- src/TestCase.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/TestCase.php b/src/TestCase.php index 47b170ad..28fe6730 100644 --- a/src/TestCase.php +++ b/src/TestCase.php @@ -233,6 +233,8 @@ public static function prepare() */ public static function setUpBeforeClass(): void { + parent::setUpBeforeClass(); + static::serve(static::getBaseServeHost(), static::getBaseServePort()); } @@ -244,6 +246,8 @@ public static function setUpBeforeClass(): void public static function tearDownAfterClass(): void { static::stopServing(); + + parent::tearDownAfterClass(); } /** From fa5d5f6eb5becf8e36b0bc13a0f67e7cb3d4646e Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Tue, 8 Aug 2023 08:52:34 +0800 Subject: [PATCH 04/11] wip Signed-off-by: Mior Muhammad Zaki --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index cceaf9db..a6e71d4c 100644 --- a/composer.json +++ b/composer.json @@ -39,7 +39,7 @@ "laravel/dusk": "^6.22.1", "opis/closure": "^3.6", "laravel/serializable-closure": "^1.0", - "orchestra/dusk-updater": "^1.7 || ^2.2", + "orchestra/dusk-updater": "^1.7.1 || ^2.2.1", "orchestra/testbench": "^6.29", "php-webdriver/webdriver": "^1.9" }, From 7011049e159ed652cb0abaf16270b41ad7dd02ae Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Tue, 8 Aug 2023 09:16:05 +0800 Subject: [PATCH 05/11] wip Signed-off-by: Mior Muhammad Zaki --- composer.json | 1 + 1 file changed, 1 insertion(+) diff --git a/composer.json b/composer.json index b0d5cf76..42ea94ae 100644 --- a/composer.json +++ b/composer.json @@ -41,6 +41,7 @@ "laravel/serializable-closure": "^1.0", "orchestra/dusk-updater": "^2.2.1", "orchestra/testbench": ">=8.5.7 <8.7.0", + "orchestra/testbench-core": "8.x-dev", "php-webdriver/webdriver": "^1.9" }, "require-dev": { From 46e96a276f7c11660253bf646db10a86d710eebb Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Tue, 8 Aug 2023 13:21:21 +0800 Subject: [PATCH 06/11] wip Signed-off-by: Mior Muhammad Zaki --- pint.json | 15 +++++++++++++++ src/Exceptions/UnableToStartServer.php | 2 +- src/TestCase.php | 1 - tests/Browser/DatabaseMigrationsTest.php | 3 ++- 4 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 pint.json diff --git a/pint.json b/pint.json new file mode 100644 index 00000000..628bd22f --- /dev/null +++ b/pint.json @@ -0,0 +1,15 @@ +{ + "preset": "laravel", + "rules": { + "native_function_invocation": { + "include": ["@compiler_optimized"], + "scope": "namespaced", + "strict": true + }, + "no_superfluous_phpdoc_tags": false, + "php_unit_method_casing": false, + "nullable_type_declaration_for_default_null_value": { + "use_nullable_type_declaration": true + } + } +} diff --git a/src/Exceptions/UnableToStartServer.php b/src/Exceptions/UnableToStartServer.php index 21199e25..db21fd33 100644 --- a/src/Exceptions/UnableToStartServer.php +++ b/src/Exceptions/UnableToStartServer.php @@ -7,7 +7,7 @@ class UnableToStartServer extends Exception { - public function __construct($message = '', $code = 0, Throwable $previous = null) + public function __construct($message = '', $code = 0, ?Throwable $previous = null) { $fullMessage = "A server is already running on {$message}. Please stop it before proceeding. \n". "It is likely to be a php server, so you can search your existing processes for 'php -L'. \n". diff --git a/src/TestCase.php b/src/TestCase.php index 28fe6730..6228f376 100644 --- a/src/TestCase.php +++ b/src/TestCase.php @@ -47,7 +47,6 @@ public static function getBaseServePort() return static::$baseServePort; } - /** * The base server host. * diff --git a/tests/Browser/DatabaseMigrationsTest.php b/tests/Browser/DatabaseMigrationsTest.php index 8aa2eac7..5f6bbd72 100644 --- a/tests/Browser/DatabaseMigrationsTest.php +++ b/tests/Browser/DatabaseMigrationsTest.php @@ -9,12 +9,13 @@ class DatabaseMigrationsTest extends TestCase { protected function setUp(): void { - $this->beforeApplicationDestroyed(function() { + $this->beforeApplicationDestroyed(function () { $this->assertFalse(Schema::hasTable('tests')); }); parent::setUp(); } + /** * Define database migrations. * From 7b615321825201e69a519f05e0c540e1167a14a4 Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Tue, 8 Aug 2023 13:22:13 +0800 Subject: [PATCH 07/11] wip Signed-off-by: Mior Muhammad Zaki --- src/TestCase.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/TestCase.php b/src/TestCase.php index 6228f376..fc7a85ed 100644 --- a/src/TestCase.php +++ b/src/TestCase.php @@ -64,7 +64,7 @@ public static function getBaseServeHost() */ public static function applicationBasePath() { - return $_ENV['APP_BASE_PATH'] ?? realpath(__DIR__.'/../laravel'); + return static::applicationBasePathUsingWorkbench() ?? realpath(__DIR__.'/../laravel'); } /** From 14a3c334edc0c28d06cdb128f9e07047c9c4008d Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Tue, 8 Aug 2023 13:26:52 +0800 Subject: [PATCH 08/11] wip Signed-off-by: Mior Muhammad Zaki --- src/TestCase.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/TestCase.php b/src/TestCase.php index fc7a85ed..f2503b5f 100644 --- a/src/TestCase.php +++ b/src/TestCase.php @@ -7,6 +7,7 @@ use Facebook\WebDriver\Remote\DesiredCapabilities; use Facebook\WebDriver\Remote\RemoteWebDriver; use Illuminate\Foundation\Application; +use Laravel\Dusk\DuskServiceProvider; use Orchestra\Testbench\Dusk\Foundation\PackageManifest; use Orchestra\Testbench\Dusk\Options as DuskOptions; use Orchestra\Testbench\TestCase as Testbench; @@ -106,6 +107,19 @@ protected function setUp(): void $this->registerShutdownFunction(); } + /** + * Get application providers. + * + * @param \Illuminate\Foundation\Application $app + * @return array + */ + protected function getApplicationProviders($app) + { + return array_merge(parent::getApplicationProviders($app), [ + DuskServiceProvider::class, + ]); + } + /** * Setup parallel testing callback. */ From a8bb4ec2272ca58a71ec5ce163b4f888ad512097 Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Tue, 8 Aug 2023 13:30:32 +0800 Subject: [PATCH 09/11] wip Signed-off-by: Mior Muhammad Zaki --- CHANGELOG-6.x.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG-6.x.md b/CHANGELOG-6.x.md index e6af73f8..c6fa72a8 100644 --- a/CHANGELOG-6.x.md +++ b/CHANGELOG-6.x.md @@ -2,6 +2,15 @@ This changelog references the relevant changes (bug and security fixes) done to `orchestra/testbench-dusk`. +## 6.32.0 + +Released: 2023-08-08 + +### Changes + +* Update minimum support for Testbench v6.29.0+. ([v6.28.0...v6.29.0](https://github.com/orchestral/testbench/compare/v6.28.0...v6.29.0)) +* Autoload `Laravel\Dusk\DuskServiceProvider` service provider. + ## 6.31.1 Released: 2023-07-25 From 8a03b1c9799c7f913b97bee72a598d923223839b Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Tue, 8 Aug 2023 13:54:21 +0800 Subject: [PATCH 10/11] wip Signed-off-by: Mior Muhammad Zaki --- src/TestCase.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/TestCase.php b/src/TestCase.php index 15265527..a1499715 100644 --- a/src/TestCase.php +++ b/src/TestCase.php @@ -65,7 +65,7 @@ public static function getBaseServeHost() */ public static function applicationBasePath() { - return static::applicationBasePathUsingWorkbench() ?? realpath(__DIR__.'/../laravel'); + return static::applicationBasePathUsingWorkbench() ?? (string) realpath(__DIR__.'/../laravel'); } /** From 9c5a4713880eb985cc49bcf41aeec7d95531488b Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Tue, 8 Aug 2023 16:43:38 +0800 Subject: [PATCH 11/11] wip Signed-off-by: Mior Muhammad Zaki --- composer.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 42ea94ae..ef532a77 100644 --- a/composer.json +++ b/composer.json @@ -40,8 +40,7 @@ "laravel/dusk": "^7.9", "laravel/serializable-closure": "^1.0", "orchestra/dusk-updater": "^2.2.1", - "orchestra/testbench": ">=8.5.7 <8.7.0", - "orchestra/testbench-core": "8.x-dev", + "orchestra/testbench": ">=8.6.0 <8.7.0", "php-webdriver/webdriver": "^1.9" }, "require-dev": {