It sounds like PEST is not being installed automatically with your new Laravel 11 project. This could be due to a variety of reasons, such as a misconfiguration or an issue with the Laravel installer. However, you can manually add PEST to your project. Here’s how you can do it:
-
Install PEST via Composer: Run the following command to install PEST in your Laravel project:
composer require pestphp/pest --dev -
Initialize PEST: After installing PEST, you need to initialize it. Run the following command:
./vendor/bin/pest --init -
Create a PEST Test: You can create a new PEST test using the artisan command:
php artisan make:test --pest NewTest -
Run the Tests: Now you should be able to run your tests using PEST:
./vendor/bin/pest -
Verify the Installation: Ensure that the
pestbinary is available in thevendor/bindirectory and that yourtestsdirectory contains the necessary PEST configuration files.
Here is a step-by-step example:
# Step 1: Install PEST
composer require pestphp/pest --dev
# Step 2: Initialize PEST
./vendor/bin/pest --init
# Step 3: Create a PEST test
php artisan make:test --pest NewTest
# Step 4: Run the tests
./vendor/bin/pest
If you follow these steps and still encounter issues, make sure your Composer dependencies are up to date by running:
composer update
Additionally, ensure that your composer.json file includes the PEST package under the require-dev section:
"require-dev": {
"pestphp/pest": "^1.0"
}
By following these steps, you should be able to set up and use PEST in your new Laravel 11 project. If the problem persists, it might be worth checking the Laravel and PEST documentation for any updates or changes.