From 13a58fa434741529fc94c72fb80285e1f8867af9 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Thu, 19 Mar 2020 21:45:19 +0000 Subject: [PATCH] 5a: The article wrapper can return an article Add a test to ensure that an `ArticleWrapper` can be used to decorate an article node, and that the original article can be retrieved again. --- .../src/Unit/Wrapper/ArticleWrapperTest.php | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 web/modules/custom/my_module/tests/src/Unit/Wrapper/ArticleWrapperTest.php diff --git a/web/modules/custom/my_module/tests/src/Unit/Wrapper/ArticleWrapperTest.php b/web/modules/custom/my_module/tests/src/Unit/Wrapper/ArticleWrapperTest.php new file mode 100644 index 0000000..48bf879 --- /dev/null +++ b/web/modules/custom/my_module/tests/src/Unit/Wrapper/ArticleWrapperTest.php @@ -0,0 +1,20 @@ +assertInstanceOf(NodeInterface::class, $articleWrapper->getOriginal()); + $this->assertSame(5, $articleWrapper->getOriginal()->id()); + $this->assertSame('article', $articleWrapper->getOriginal()->bundle()); + } + +} +