From a399aa31c1c9cef793ad747403017e56df77396c Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Fri, 22 Nov 2024 01:37:39 +0800 Subject: [PATCH 1/4] [8.x] Supports PHP 8.4 (#1131) * [8.x] Supports PHP 8.4 Signed-off-by: Mior Muhammad Zaki * wip Signed-off-by: Mior Muhammad Zaki * wip Signed-off-by: Mior Muhammad Zaki * wip Signed-off-by: Mior Muhammad Zaki * wip Signed-off-by: Mior Muhammad Zaki * wip Signed-off-by: Mior Muhammad Zaki * wip * wip --------- Signed-off-by: Mior Muhammad Zaki --- .github/workflows/browser-tests.yml | 12 ++++++++---- .github/workflows/tests.yml | 17 ++++++++++------- composer.json | 2 +- 3 files changed, 19 insertions(+), 12 deletions(-) diff --git a/.github/workflows/browser-tests.yml b/.github/workflows/browser-tests.yml index 6db38ecfa..f6e422e8f 100644 --- a/.github/workflows/browser-tests.yml +++ b/.github/workflows/browser-tests.yml @@ -20,12 +20,16 @@ jobs: matrix: php: [8.1, 8.2, 8.3] laravel: [10, 11] - phpunit: [10.5, '11.0'] + phpunit: [10.5, 11] + include: + - php: 8.4 + laravel: 11 + phpunit: 11.3 exclude: - php: 8.1 laravel: 11 - laravel: 10 - phpunit: '11.0' + phpunit: 11 name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} - PHPUnit ${{ matrix.phpunit }} @@ -44,7 +48,7 @@ jobs: - name: Install dependencies run: | - composer update --prefer-dist --no-interaction --no-progress --with=illuminate/support:^${{ matrix.laravel }} --with=phpunit/phpunit:^${{ matrix.phpunit }} + composer update --prefer-dist --no-interaction --no-progress --with=laravel/framework:^${{ matrix.laravel }} --with=phpunit/phpunit:^${{ matrix.phpunit }} - name: Upgrade Chrome Driver run: php vendor/bin/testbench dusk:chrome-driver --detect @@ -56,6 +60,6 @@ jobs: run: php vendor/bin/testbench serve --no-reload & - name: Execute tests - run: php vendor/bin/phpunit -c phpunit.dusk.xml.dist + run: php vendor/bin/phpunit -c phpunit.dusk.xml.dist --display-deprecations --fail-on-deprecation env: APP_URL: http://127.0.0.1:8000 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 694b05e0b..a32c4ddf6 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -20,12 +20,16 @@ jobs: matrix: php: [8.1, 8.2, 8.3] laravel: [10, 11] - phpunit: [10.5, '11.0'] + phpunit: [10.5, 11] + include: + - php: 8.4 + laravel: 11 + phpunit: 11.3 exclude: - php: 8.1 laravel: 11 - laravel: 10 - phpunit: '11.0' + phpunit: 11 name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} - PHPUnit ${{ matrix.phpunit }} @@ -44,11 +48,10 @@ jobs: - name: Install dependencies run: | - composer require "illuminate/contracts:^${{ matrix.laravel }}" "phpunit/phpunit:^${{ matrix.phpunit }}" --dev --no-update - composer update --prefer-dist --no-interaction --no-progress + composer update --prefer-dist --no-interaction --no-progress --with="laravel/framework:^${{ matrix.laravel }}" --with="phpunit/phpunit:^${{ matrix.phpunit }}" - name: Execute tests - run: vendor/bin/phpunit -c phpunit.xml.dist + run: vendor/bin/phpunit -c phpunit.xml.dist --display-deprecations --fail-on-deprecation stub-tests: runs-on: ubuntu-22.04 @@ -56,8 +59,8 @@ jobs: strategy: fail-fast: true matrix: - php: [8.2] - laravel: [10] + php: [8.2, 8.3, 8.4] + laravel: [10, 11] name: Test Stubs PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} diff --git a/composer.json b/composer.json index e6fd0630e..3cb020665 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,7 @@ "guzzlehttp/guzzle": "^7.5", "illuminate/console": "^10.0|^11.0", "illuminate/support": "^10.0|^11.0", - "php-webdriver/webdriver": "^1.9.0", + "php-webdriver/webdriver": "^1.15.2", "symfony/console": "^6.2|^7.0", "symfony/finder": "^6.2|^7.0", "symfony/process": "^6.2|^7.0", From 204151b60922ed40e9af4b76f54a071933d5b4e5 Mon Sep 17 00:00:00 2001 From: taylorotwell Date: Tue, 26 Nov 2024 15:24:38 +0000 Subject: [PATCH 2/4] Update CHANGELOG --- CHANGELOG.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1d7da690f..637a6382d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ # Release Notes -## [Unreleased](https://github.com/laravel/dusk/compare/v8.2.11...8.x) +## [Unreleased](https://github.com/laravel/dusk/compare/v8.2.12...8.x) + +## [v8.2.12](https://github.com/laravel/dusk/compare/v8.2.11...v8.2.12) - 2024-11-21 + +* [8.x] Supports PHP 8.4 by [@crynobone](https://github.com/crynobone) in https://github.com/laravel/dusk/pull/1131 ## [v8.2.11](https://github.com/laravel/dusk/compare/v8.2.10...v8.2.11) - 2024-11-07 From 8ddd53a74c2e6f9c3b68cf8189dad44077b585b0 Mon Sep 17 00:00:00 2001 From: Jacco Broeren Date: Mon, 6 Jan 2025 15:52:17 +0100 Subject: [PATCH 3/4] [8.x] Behaviour change on assertAttributeDoesntContain (#1154) * Update MakesAssertions.php * Update MakesAssertions.php revert changes on wrong place and add correct changes * Update MakesAssertions.php remove whitespace * Update MakesAssertionsTest.php Update test_assert_attribute_does_not_contain to reflect new behaviour. * Update MakesAssertions.php remove whitespace --- src/Concerns/MakesAssertions.php | 9 +++------ tests/Unit/MakesAssertionsTest.php | 10 +--------- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/src/Concerns/MakesAssertions.php b/src/Concerns/MakesAssertions.php index 9d348586d..0ca2ff633 100644 --- a/src/Concerns/MakesAssertions.php +++ b/src/Concerns/MakesAssertions.php @@ -827,14 +827,11 @@ public function assertAttributeContains($selector, $attribute, $value) */ public function assertAttributeDoesntContain($selector, $attribute, $value) { - $fullSelector = $this->resolver->format($selector); - $actual = $this->resolver->findOrFail($selector)->getAttribute($attribute); - PHPUnit::assertNotNull( - $actual, - "Did not see expected attribute [{$attribute}] within element [{$fullSelector}]." - ); + if (is_null($actual)) { + return $this; + } PHPUnit::assertStringNotContainsString( $value, diff --git a/tests/Unit/MakesAssertionsTest.php b/tests/Unit/MakesAssertionsTest.php index 3160ffd43..ebea4026a 100644 --- a/tests/Unit/MakesAssertionsTest.php +++ b/tests/Unit/MakesAssertionsTest.php @@ -683,15 +683,7 @@ public function test_assert_attribute_does_not_contain() $browser->assertAttributeDoesntContain('foo', 'bar', 'class-c'); - try { - $browser->assertAttributeDoesntContain('foo', 'bar', 'class-c'); - $this->fail(); - } catch (ExpectationFailedException $e) { - $this->assertStringContainsString( - 'Did not see expected attribute [bar] within element [Foo].', - $e->getMessage() - ); - } + $browser->assertAttributeDoesntContain('foo', 'bar', 'class-c'); try { $browser->assertAttributeDoesntContain('foo', 'bar', 'class-1'); From 7d4d4142d64039fb9373a726cb0cbaf69d7e6ab1 Mon Sep 17 00:00:00 2001 From: taylorotwell <463230+taylorotwell@users.noreply.github.com> Date: Tue, 14 Jan 2025 15:45:09 +0000 Subject: [PATCH 4/4] Update CHANGELOG --- CHANGELOG.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 637a6382d..f706696a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ # Release Notes -## [Unreleased](https://github.com/laravel/dusk/compare/v8.2.12...8.x) +## [Unreleased](https://github.com/laravel/dusk/compare/v8.2.13...8.x) + +## [v8.2.13](https://github.com/laravel/dusk/compare/v8.2.12...v8.2.13) - 2025-01-06 + +* [8.x] Behaviour change on assertAttributeDoesntContain by [@F2210](https://github.com/F2210) in https://github.com/laravel/dusk/pull/1154 ## [v8.2.12](https://github.com/laravel/dusk/compare/v8.2.11...v8.2.12) - 2024-11-21