When giving talks and workshops or coaching on automated testing and test-driven development, some people may not have written tests before and aren’t familiar with the structure or know where to begin.
In the workshops I ran for DrupalCamp London and DrupalCamp NYC, I wanted to cover this first before writing any implementation code.
Where do you put a test class, and what does it contain?
How do you run the tests, and how can you make it pass or fail?
What we did
To start, we wrote a test for existing functionality within Drupal core - anonymous users can visit the front page.