oliverdavies.uk/web/modules/custom/blog
Oliver Davies 059e237600 Prevent duplicate terms being created
Within the `PostFactory` class, ensure that when using the `withTags`
method and creating tag terms that an existing term doesn't already
exist for a given name before trying to create it.

With the previous implementation, there would be multiple terms if the
PostFactory was used multiple times with the same tag name.

Given that `PostFactory` now has a dependency on `EntityTypeManger`,
this has been added as a service within `opdavies_blog_test` and needs
to be resolved from the container before trying to use it within a test.

This commit also updates the usages in `PostTest` so that those tests
continue to work and pass.

References #3
2021-01-10 22:38:36 +00:00
..
config/schema Rename variable to make it more generic 2021-01-01 21:46:12 +00:00
hooks Rename custom module directories 2020-09-04 21:25:36 +01:00
src Refactor to use an entity query 2021-01-10 22:38:02 +00:00
tests Prevent duplicate terms being created 2021-01-10 22:38:36 +00:00
drush.services.yml Rename custom module directories 2020-09-04 21:25:36 +01:00
opdavies_blog.info.yml Rename custom module directories 2020-09-04 21:25:36 +01:00
opdavies_blog.install Extract helper methods 2020-11-10 20:25:07 +00:00
opdavies_blog.module Rename custom module directories 2020-09-04 21:25:36 +01:00
opdavies_blog.services.yml Return related posts for a specified blog post 2021-01-10 22:38:00 +00:00