Since performing unit tests is hard in D7, and this code doesn't use classes or interfaces, the only options are Simpletest and Behat. I'd prefer to add testing to every issue beginning with a D8 branch/migration, but a few tests would be beneficial to run.

The invite process for a site seems to have bugs every now and again that would be caught by a few tests.
- Access invite page
- Roles exist
- Sending invite doesn't cause error
- etc

Comments

afinnarn created an issue. See original summary.

afinnarn’s picture

Status: Active » Closed (outdated)

This will be the first step in creating a D8 branch.

afinnarn’s picture

Status: Closed (outdated) » Active

actually, this ticket is still worthwhile in 7.x

afinnarn’s picture

I've created a 7.x-2.x branch so that some changes we made at CU Boulder can be merged back in the module without screwing anything up until tests are added to confirm that current behavior works.

I've mainly written Behat tests before, but PHPUnit tests would also be nice to have as well.

Example Behat tests: https://github.com/CuBoulder/express/blob/dev/tests/behat/features/Expre...

afinnarn’s picture

Lullabot writes good example blog posts to follow: https://www.lullabot.com/articles/write-unit-tests-for-your-drupal-7-cod...

afinnarn’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev