5a: Create a mock article

As this is a unit test, we don’t have access to a database or the
service container, so we will need to use a mock.

This is enough to pass the `instanceOf` assertion, but the others are
failing as those methods are returning `null`.
This commit is contained in:
Oliver Davies 2020-03-19 21:49:53 +00:00
parent 8d309299ea
commit fd9f9e7e48

View file

@ -10,6 +10,8 @@ class ArticleWrapperTest extends UnitTestCase {
/** @test */
public function it_can_return_the_article() {
$article = $this->createMock(NodeInterface::class);
$articleWrapper = new ArticleWrapper($article);
$this->assertInstanceOf(NodeInterface::class, $articleWrapper->getOriginal());