If you are working with Valet
you would probably have multiple projects, running multiple PHP
versions
PHPStorm
is able to run test inside the IDE
, but you need to configure a PHPCLI interpreter
and every version has its own executable path
You are going to be able to see all the PHP
versions that you have available using Valet
by running
ls /opt/homebrew/Cellar
You would find different directories for different PHP
versions,
in this example I am using php 8.0.18
, so I can see the executable files by running
ls /opt/homebrew/Cellar/php@8.0/8.0.18/bin/php
This is the path to set this PHP
cli interpreter
to your project in PHPStorm
You can replace the values as your need
ls /opt/homebrew/Cellar/php@<PHP_VERSION>/<PHP_VERSION>/bin/php
You can dive into the Cellar directory to check the different versions and get a list with
the PHP
files that you need for your current version
Now you are able to run tests
Thanks for reading!
Sign up & get tips and tricks
You'll get monthly updates regarding my most recent articles and products.