The example code for my automated testing workshop
Find a file
Oliver Davies 07ad4dc2b1 5b: Check that it returns the post title
> Drupal\Tests\my_module\Unit\Entity\PostTest::it_returns_the_title
> Error: Call to undefined method Drupal\my_module\Entity\Post::getTitle()
2020-11-14 10:09:38 +00:00
.ddev Initial commit 2020-11-14 10:09:37 +00:00
.github/workflows Initial commit 2020-11-14 10:09:37 +00:00
.idea Initial commit 2020-11-14 10:09:37 +00:00
config Initial commit 2020-11-14 10:09:37 +00:00
web 5b: Check that it returns the post title 2020-11-14 10:09:38 +00:00
.gitignore 1b: Add my_module.info.yml 2020-11-14 10:09:38 +00:00
composer.json Initial commit 2020-11-14 10:09:37 +00:00
composer.lock Initial commit 2020-11-14 10:09:37 +00:00
phpunit.xml.dist Initial commit 2020-11-14 10:09:37 +00:00
README.md Initial commit 2020-11-14 10:09:37 +00:00
workspace.yml Initial commit 2020-11-14 10:09:37 +00:00

Drupal Automated Testing Workshop: Example Code

Updates

If we need to update any of the commits, the changes should be rebased into the existing commits so that they continue to be in a linear order as per the workshop document.

As we want GitHub Actions to run for each commit, we cant just push the latest commit as that would only trigger a build on the final commit. To do this, we can loop over each of the commit SHAs and push each one separately:

for sha1 in $(git rev-list HEAD --reverse); do
  git push origin $sha1:main --force
done