Running a php 7.3 build, pre-installed PHPUnit 9 fails:
$ phpunit
PHPUnit 9.0.1 by Sebastian Bergmann and contributors.
Cannot open file "/home/travis/build/[secure]/carddav2fb/vendor/autoload.php".
The command "phpunit" exited with 1.
This happens due to the PHPUnit step executed before the repo is cloned. It seems that PHPUnit 9.1does not have this behaviour.
This is still a problem. The PHP 7.3 version is unusable for me:
$ phpenv global 7.3
$ composer self-update
Updating to version 1.10.7 (stable channel).
Downloading (connecting...)Downloading (100%)
Use composer self-update --rollback to return to version 1.10.6
Setting up build cache
$ php --version
PHP 7.3.18 (cli) (built: May 15 2020 06:05:01) ( ZTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.18, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.3.18, Copyright (c) 1999-2018, by Zend Technologies
with Xdebug v2.9.5, Copyright (c) 2002-2020, by Derick Rethans
$ composer --version
Composer version 1.10.7 2020-06-03 10:03:56
$ phpunit
PHPUnit 9.1.4 by Sebastian Bergmann and contributors.
Cannot open file "/home/travis/build/[secure]/carddav2fb/vendor/autoload.php".
The file does not exist because it will only exist after composer install has run. I wrote:
This happens due to the PHPUnit step executed before the repo is cloned. It seems that PHPUnit 9.1does not have this behaviour.
I was wrong about repo being cloned, the relevant step is composer install.
The main point here is that- independent from matrix vs jobs (which I’ll double-check) that invoking phpunit before composer is broken when phpunit 9.0 is used. As this is happening before using script in travis is run, it’s out of user’s control.
In PHP, there is no default install step, so composer install should not be running. I don’t see the evidence it, either. If your repo is expecting to run composer install in the install phase, you’ll have to make sure that it is. (Because it is not, due to your error in .travis.yml.)
Indeed, thanks to your hint I was able to fix the config. This used to work before (which is what users are always saying, I know ;).
I understand the install step is run before phpunit version is executed. I wasn‘t aware of the connection, thank you very much!