Auto-Detect Test Framework0:01
Let's wrap up this series by taking a few minutes to talk about testing changes in Laravel 11. In this Laravel 10 application, note that I'm making use of PES PHP as my testing framework of choice. However, when I generate a test file from the terminal with php artisan make:test, well it's not going to use PES syntax, it's going to use PHPUnit syntax. If I wanted PES syntax in the past, I'd have to append the PES flag to the end, and now you can see, yeah, the test is generated using PES functional syntax. In Laravel 11, it's actually able to detect exactly which testing framework I'm using, and it will automatically select the right stub for me. So switching over to our Laravel 11 application, let's run the same command, php artisan make:test MyExampleTest, and note that when we open that test, it's using PES syntax out of the box. If you're on the flip side of the coin and you're using PHPUnit, Laravel will detect that instead, and what's generated here will be a full PHPUnit class as you've always been used to. It's nice that no matter which testing framework you prefer, PHPUnit or PES PHP, they're now both first class citizens inside the framework.
and what's generated here will be a full PHPUnit class as you've always been used to. It's nice that no matter which testing framework you prefer, PHPUnit or Pest, they're now both first class citizens inside the framework.
