I ran into problems running tests with SilverStripe 4.1, so I reduced it down to a minimal case in order to repeat and then resolve the issues. This is a meaningless module functionality wise, it's purposes is to provide an example for others so they don't headbang like I did.
- An obvious one in hindsight, but your module must pull in the framework either directly or indirectly
- The version of PHP Unit needs to be pinned in requires-dev, to version
^5.7
, newer versions cause autoloading issues that prevent SapphireTest class from being found (the initial reason I wrote this module). The relevant section of composer.json is this
"require-dev": {
"phpunit/phpunit": "^5.7",
},```
* With 4.1, one needs to use `--prefer-source` instead of `--prefer-dist`, otherwise test classes do not get downloaded.
They are now removed from distributions to reduce install size. See https://github.com/silverstripe/silverstripe-framework/issues/7845
## Credits
- [Gordon Anderson][link-author]
## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.