SuiteCRM test suite

Hello.

I have SuiteCRM version 7.10.9 install, and I followed the instructions at “https://docs.suitecrm.com/developer/appendix-c---automated-testing/” to install the testing framework.

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)?

Thanks,

Carl

I never did this myself but your logic seems correct - just grab the “tests” directory and go ahead.

Tell me if it works for you, or if you find additional steps are required, we might edit the Docs if needed.

Hello.

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

Not sure what I am doing wrong.

Regards,

Carl

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.

Does anyone know why this is? What am I missing?

Thanks,

Carl

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.

Regards,

Carl

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!