From 01289d871100c1bb61ced20073f0869a9f5d2d39 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Sat, 20 Jan 2024 22:10:12 +0000 Subject: [PATCH] Add lesson 9 --- web/modules/custom/example/tests/src/Unit/PostWrapperTest.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web/modules/custom/example/tests/src/Unit/PostWrapperTest.php b/web/modules/custom/example/tests/src/Unit/PostWrapperTest.php index 9884d3d..868c15a 100644 --- a/web/modules/custom/example/tests/src/Unit/PostWrapperTest.php +++ b/web/modules/custom/example/tests/src/Unit/PostWrapperTest.php @@ -3,6 +3,7 @@ namespace Drupal\Tests\example\Unit; use Drupal\example\PostWrapper; +use Drupal\node\Entity\Node; use Drupal\node\NodeInterface; use Drupal\Tests\UnitTestCase; @@ -13,7 +14,7 @@ final class PostWrapperTest extends UnitTestCase { /** @test */ public function it_wraps_a_post(): void { - $node = $this->createMock(NodeInterface::class); + $node = Node::create(['type' => 'post']); $node->method('bundle')->willReturn('post'); $wrapper = new PostWrapper($node);