tantek / cassis

CASSIS is universal javascript/PHP that works on the client and the server for scalable application logic.
http://cassisjs.org/
128 stars 10 forks source link

Include phpunit and automate unit tests #39

Open gRegorLove opened 1 year ago

gRegorLove commented 1 year ago

The readme instructions to run phpunit.phar presume that you have phpunit installed already. If you don't, the unit tests won't run. It would probably be better to include phpunit under require-dev in composer.json and set up a composer script to run them.

The tests appear to be written for phpunit ~5.7 and won't run under v9+. Depending on which versions you want to list as supported (#38), it would be a good idea to set up Github Actions to run the unit tests for the supported PHP versions. If you want to support PHP 5.6 through 8.2, this polyfill makes it pretty easy to make the unit tests cross-version compatible. That's implemented on a few projects like https://github.com/microformats/php-mf2