From e79a63476ea8bb27e11ded64bbb3c34a69425337 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Thu, 19 Mar 2020 21:26:28 +0000 Subject: [PATCH] 4h: Add page nodes to break the test 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. --- .../custom/my_module/tests/src/Kernel/ArticleRepositoryTest.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/web/modules/custom/my_module/tests/src/Kernel/ArticleRepositoryTest.php b/web/modules/custom/my_module/tests/src/Kernel/ArticleRepositoryTest.php index ebfa195..70b32a1 100644 --- a/web/modules/custom/my_module/tests/src/Kernel/ArticleRepositoryTest.php +++ b/web/modules/custom/my_module/tests/src/Kernel/ArticleRepositoryTest.php @@ -28,7 +28,9 @@ class ArticleRepositoryTest extends EntityKernelTestBase { /** @test */ public function nodes_that_are_not_articles_are_not_returned() { $this->createNode(['type' => 'article'])->save(); + $this->createNode(['type' => 'page'])->save(); $this->createNode(['type' => 'article'])->save(); + $this->createNode(['type' => 'page'])->save(); $this->createNode(['type' => 'article'])->save(); $repository = $this->container->get(ArticleRepository::class);