I had hoped that that would install the SuiteCRM unit tests, so I could use that code as a basis for creating my own. Could someone let me know if there is some simple step to do this, or do I need to download that code from GitHub (presumably I need the entire https://github.com/salesagility/SuiteCRM/tree/master/tests directory structure)?
I have downloaded the “tests” directory from GitHub and replaced the “tests” directory in my SuiteCRM directory. I then ran “./vendor/bin/codecept run unit” and got:
Codeception PHP Testing Framework v2.4.1
Powered by PHPUnit 4.8.36 by Sebastian Bergmann and contributors.
Not A Valid Entry Point
I’ve done a bit more digging and the error is happening as soon as it is loading StateCheckerUnitAbstract.php. It appears that the tests/unit/_bootstrap.php is not being loaded first.
Ok, figured it out. The SuiteCRM-7.10.9.zip files does not include the codeception.yml file that is in the GitHub repository. I ran “codecept bootstrap”, which generated one, but it didn’t include the bits and pieces that were needed.
I copied the codeception.yml file from the repository and it worked.
We should potentially update the docs to mention this. Up until now I think the assumption has been that you would be pulling down from Git if you were writing/running unit tests. Thanks for pointing this out!