Reputation: 12562
travis-ci allow run phpunit over some PHP versions.
The problem is that my composer.json
requires phpunit/phpunit=~4.8
, and on phpunit 4.8.20 was declared that PHP 7.0+ isn't supported anymore. This PHP version should uses phpunit/phpunit=~5.1
that is supported on PHP 5.6+.
My package requires runs on PHP 5.4+.
I can solve it by unsupporting PHP 5.4 and PHP 5.5, but all tests works perfectly on this versions, and on my country this versions yet are used by a lot hosts.
I think that is possible do something like it:
"phpunit/phpunit": "if php < 7 then ~4.8 else ~5.1"
Maybe config.platform
help me? I can't understand how it works too.
Upvotes: 2
Views: 1181
Reputation: 70933
You can make or-requirements in Composer. If you want to say that PHPUnit can be used in version 4.8 or 5.x, it is:
"phpunit/phpunit": "~4.8|~5.0"
You have to run update
in your build script, but Composer will figure it out depending on the PHP version it detects.
It is your responsibility to maintain compatibility of your tests with either version, but Travic will detect failures pretty soon, won't it?
Upvotes: 3