From 8d309299ea9a48340db4b29b3ea35fbb83108b47 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Thu, 19 Mar 2020 21:47:40 +0000 Subject: [PATCH] 5a: Create the ArticleWrapper class MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add the contents for the article wrapper class. This fails as there’s no article to wrap yet within the test. --- .../my_module/src/Wrapper/ArticleWrapper.php | 19 +++++++++++++++++++ .../src/Unit/Wrapper/ArticleWrapperTest.php | 1 + 2 files changed, 20 insertions(+) create mode 100644 web/modules/custom/my_module/src/Wrapper/ArticleWrapper.php diff --git a/web/modules/custom/my_module/src/Wrapper/ArticleWrapper.php b/web/modules/custom/my_module/src/Wrapper/ArticleWrapper.php new file mode 100644 index 0000000..e48af1c --- /dev/null +++ b/web/modules/custom/my_module/src/Wrapper/ArticleWrapper.php @@ -0,0 +1,19 @@ +article = $node; + } + + public function getOriginal(): NodeInterface { + return $this->article; + } + +} 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 index 48bf879..5cd68df 100644 --- a/web/modules/custom/my_module/tests/src/Unit/Wrapper/ArticleWrapperTest.php +++ b/web/modules/custom/my_module/tests/src/Unit/Wrapper/ArticleWrapperTest.php @@ -2,6 +2,7 @@ namespace Drupal\Tests\my_module\Unit\Wrapper; +use Drupal\my_module\Wrapper\ArticleWrapper; use Drupal\node\NodeInterface; use Drupal\Tests\UnitTestCase;