5a: Create the ArticleWrapper class

Add the contents for the article wrapper class.

This fails as there’s no article to wrap yet within the test.
This commit is contained in:
Oliver Davies 2020-03-19 21:47:40 +00:00
parent 13a58fa434
commit 8d309299ea
2 changed files with 20 additions and 0 deletions

View file

@ -0,0 +1,19 @@
<?php
namespace Drupal\my_module\Wrapper;
use Drupal\node\NodeInterface;
class ArticleWrapper {
private $article;
public function __construct(NodeInterface $node) {
$this->article = $node;
}
public function getOriginal(): NodeInterface {
return $this->article;
}
}

View file

@ -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;