From 9aec3279454e31bca47154ad172d613395e69408 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Sat, 14 Nov 2020 09:46:05 +0000 Subject: [PATCH] 4l: Expect a custom Post class to be returned --- web/modules/custom/my_module/src/Entity/Post.php | 5 +++++ .../my_module/tests/src/Kernel/ArticleRepositoryTest.php | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 web/modules/custom/my_module/src/Entity/Post.php diff --git a/web/modules/custom/my_module/src/Entity/Post.php b/web/modules/custom/my_module/src/Entity/Post.php new file mode 100644 index 0000000..9690518 --- /dev/null +++ b/web/modules/custom/my_module/src/Entity/Post.php @@ -0,0 +1,5 @@ +assertCount(1, $articles); $this->assertIsObject($articles[1]); - $this->assertInstanceOf(NodeInterface::class, $articles[1]); - $this->assertSame('article', $articles[1]->bundle()); - $this->assertSame('Test post', $articles[1]->label()); + $this->assertInstanceOf(Post::class, $articles[1]); + $this->assertSame('Test post', $articles[1]->getTitle()); } /** @test */