From 0c518d3d37434ff6288d51abf9d98e4c074eefb9 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Thu, 19 Mar 2020 21:06:52 +0000 Subject: [PATCH] 4a: Ensure that only articles are returned 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. --- .../tests/src/Kernel/ArticleRepositoryTest.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 web/modules/custom/my_module/tests/src/Kernel/ArticleRepositoryTest.php diff --git a/web/modules/custom/my_module/tests/src/Kernel/ArticleRepositoryTest.php b/web/modules/custom/my_module/tests/src/Kernel/ArticleRepositoryTest.php new file mode 100644 index 0000000..d68bf1e --- /dev/null +++ b/web/modules/custom/my_module/tests/src/Kernel/ArticleRepositoryTest.php @@ -0,0 +1,18 @@ +container->get(ArticleRepository::class); + $articles = $repository->getAll(); + + $this->assertCount(3, $articles); + } + +} +