Skip to content
Advertisement

Run test in phpunit with specific php version

I have installed multiple PHP versions on my Mac and want to run unit-tests against a specific PHP version (or against multipls versions)

Here’s the php versions I have:

JavaScript

My test case looks like this:

JavaScript

When I run the test I get this response:

JavaScript

How can I run the tests with the php version 5.2.17?


Update:

I discover that PHPUnit does not run with php5.2.17 anymore. So I change my requirements to run unit tests with php5.3.5, which is supported.

Advertisement

Answer

JavaScript

Create a script e.g. phpunit-using-5.2

JavaScript

Now you can run it:

JavaScript

Or you can create a bash alias too.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement