From 19f6f0287a4692a3de7ce43a579cfe2b3cc3d798 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Thu, 18 Jan 2024 13:15:55 +0000 Subject: [PATCH] Add tags to the post with `PostBuilder` > Error: Call to undefined method Drupal\example\Builder\PostBuilder::setTags() --- .../custom/example/tests/src/Kernel/Builder/PostBuilderTest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/web/modules/custom/example/tests/src/Kernel/Builder/PostBuilderTest.php b/web/modules/custom/example/tests/src/Kernel/Builder/PostBuilderTest.php index 174a882..9067edb 100644 --- a/web/modules/custom/example/tests/src/Kernel/Builder/PostBuilderTest.php +++ b/web/modules/custom/example/tests/src/Kernel/Builder/PostBuilderTest.php @@ -52,6 +52,7 @@ final class PostBuilderTest extends EntityKernelTestBase { $node = PostBuilder::create() ->setTitle('test') + ->setTags(['Drupal', 'PHP', 'Testing']) ->getPost(); self::assertInstanceOf(NodeInterface::class, $node);