You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GH Actions: actually get the tests running on all PHP versions
This fixes the problem originally identified by roelofr with the `Fatal error: Interface 'JsonSerializable' not found` error.
The problem had nothing to do with the PHP setup, but everything with some inane setting of the Nette testing framework as can be seen in the transcript of older, failing trial runs done by roelofr while setting up the GH Actions workflows:
```
Run composer test
> @php vendor/bin/tester -p php tests
_____ ___ ___ _____ ___ ___
|_ _/ __)( __/_ _/ __)| _ )
|_| \___ /___) |_| \___ |_|_\ v2.3.5
Note: No php.ini is used.
```
The key here is the `Note: No php.ini is used.`.
As the system `php.ini` was not being used, no extensions were loaded, which was causing the errors.
This is a change which was introduced in Nette Tester 2.0.0. As of that version, you need to always tell the Nette testing framework explicitly which `php.ini` file to use, `-C` tells it to use the system-wide `php.ini`, with `-c` you can specify a path to a `php.ini` file and by default **_no `php.ini` is used_**.
(_honestly, why did anyone ever think making that the default was a good idea ?!!?_)
As the tests will be running on different versions of the Nette Framework, Nette 1.x for PHP 5.4 and 5.5 and Nette 2.x for PHP 5.6+ and Nette 1.x, does not yet support the `-C` option and breaks when it is used, I've added a second test script to the `composer.json` file with the correct command line options to run Nette on PHP 5.4/5.5 and added conditions to the GH Actions workflow to use the correct script depending on the PHP/Nette test framework version being used.
Refs:
* https://tester.nette.org/en/running-tests#toc-c-path
* https://tester.nette.org/en/guide#toc-supported-php-versions
* https://github.com/nette/tester/releases/tag/v2.0.0
0 commit comments