From 89a6f933ecee7f7d857b9f68312f39ae26d8010f Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Sat, 20 Jan 2024 09:10:38 +0000 Subject: [PATCH] Use a mock node --- .../custom/example/tests/src/Unit/PostWrapperTest.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/web/modules/custom/example/tests/src/Unit/PostWrapperTest.php b/web/modules/custom/example/tests/src/Unit/PostWrapperTest.php index 8785b8d..7a772c0 100644 --- a/web/modules/custom/example/tests/src/Unit/PostWrapperTest.php +++ b/web/modules/custom/example/tests/src/Unit/PostWrapperTest.php @@ -2,7 +2,6 @@ namespace Drupal\Tests\example\Unit; -use Drupal\node\Entity\Node; use Drupal\node\NodeInterface; use Drupal\Tests\UnitTestCase; @@ -13,10 +12,7 @@ final class PostWrapperTest extends UnitTestCase { /** @test */ public function it_wraps_a_post(): void { - $node = new Node( - entity_type: 'post', - values: [], - ); + $node = $this->createMock(NodeInterface::class); self::assertInstanceOf(NodeInterface::class, $node); }