Add a test to ensure that the articles are returned from the article
repository based on their created date, with the newest articles
returned first.
The articles are created with defined created dates and created in a
specific order to ensure that the test doesn’t pass by default.
Add a test to ensure that only published articles are returned from the
article repository.
Currently there is no filter on the published status, so too many nodes
are returned.
Also create a number of page (not article) nodes within the test to
ensure that these are excluded. Currently they are returned so too many
nodes are returned.
This is causing a failure as the expected count value is no longer being
returned.
Install the configuration from the filter module, so that there are
filters created and to avoid the `id() on bool` error.
This fails are there is a missing database table.
Create some article nodes within the test so that there are some nodes
to return from the article repository.
This fails due to an error from the filter module.
Enable autowiring so that the entity type manager is injected into the
ArticleRepository service.
This fails because the 'node' entity type doesn’t exist.
Inject the entity type manager service into the ArticleRepository, and
use it to load and return all nodes.
This fails as not enough arguments are passed to the article repository
service from the container.
Add the `getAll()` method to the ArticleRepository, ensuring that it
returns an array.
This returns as 0 articles are returned, but 3 are expected in the
assertion.
Start adding a kernel test that retrieves article nodes from an
`ArticleRepository` and ensures that only articles are returned.
This fails due to a non-existent service.
Add more assertions to ensure that the correct page title is returned as
well as some text on the page.
This fails as the expected test is not returned.
Add the BlogPageController that is referenced within
`my_module.routing.yml`.
We will need to return a render array, but for now let’s return an empty
array.
The test now passes as we are getting the expected response code.
Enable the node module within the test to add the `access content`
permission.
This fails, and returns a 500 response code rather than the expected 200
response code.
Add a `my_module.routing.yml` file that adds the missing route for
`/blog`.
This fails, and returns a 403 response code rather than the expected 200
response code.
Add the new `BlogPageTest` functional test to ensure that anonymous
users can access the `/blog` page.
This fails, and returns a 404 response code rather than the expected 200
response code.