Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.x] Laravel Framework 11.x and Laravel Dusk 8.x support #35

Merged
merged 8 commits into from
Oct 20, 2024

Conversation

derekmd
Copy link
Owner

@derekmd derekmd commented Oct 20, 2024

Fixes #34

  1. Major version bump Composer dependencies so 3.x of this package will support laravel/dusk:^8.0. This requires PHP v8.1+, Laravel Framework v10+, and PHPUnit v10+.
  2. Replace deprecated PHPUnit annotations @after and @beforeClass with PHPUnit v10+ attributes #[After] and #[BeforeClass].
  3. Remove base test class stub methods Derekmd\Dusk\Concerns\TogglesHeadlessMode::hasHeadlessDisabled() and shouldStartMaximized() now redundant in Laravel Dusk v8.
  4. Derekmd\Dusk\Console\*Command classes now have lazy-definitions so these testing classes don't need to be instantiated when other Laravel commands are run in the local environment.
  5. php artisan dusk:install-firefox handles apps missing trait tests/CreatesApplication.php. Laravel 11 has pulled this trait's code into the framework.

Note

Apps upgrading to "derekmd/laravel-dusk-firefox" v3.0 may need to run command php artisan dusk:install-firefox or php artisan dusk:install-firefox --with-chrome to overwrite tests/DuskTestCase.php. If trait file tests/CreatesApplication.php still exists, this step isn't required.

Match dependency versions of laravel/dusk 8.x for Laravel 10 & 11.
Laravel Dusk 8.x supports both. Feel free to submit a PR
to this repo for Pest support.
* Add 'composer lint' command.
* Update GitHub Actions CI command to latest v3 args. Changing CLI args
  in a minor version is a choice.
* @after annotation is replaced by the After attribute
* Migrate phpunit.xml configuration to the current schema
laravel/dusk#1098

Laravel Dusk 8.x now defines these methods in class
Laravel\Dusk\TestCase so the stub classes that extend
TestCase don't need to redefine hasHeadlessDisabled()
and shouldStartMaximized().
laravel/framework#50617

No need to instantiate all 3 of these commands when
running another command.
Laravel 11+ apps may be missing file tests/CreatesApplication.php
because its code has been moved into the framework as method
Illuminate\Foundation\Testing\TestCase::createApplication().

Installing a new Dusk test case class stub will remove the
unneeded CreatesApplication reference.
@derekmd derekmd merged commit 0b7e2cf into master Oct 20, 2024
6 checks passed
@derekmd derekmd deleted the feat/laravel-dusk-8.x branch October 20, 2024 23:31
@derekmd derekmd changed the title [3.x] Laravel 11.x and Laravel Dusk 8.x support [3.x] Laravel Framework 11.x and Laravel Dusk 8.x support Oct 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

not working with laravel 11, laravel dusk 8.2.9
1 participant