diff --git a/tests/src/Kernel/AbstractTestCase.php b/tests/src/Kernel/AbstractTestCase.php new file mode 100644 index 0000000..9d771c8 --- /dev/null +++ b/tests/src/Kernel/AbstractTestCase.php @@ -0,0 +1,45 @@ + 10, ], ]; - self::assertSame($expected_build, $build); + self::assertRenderArray($expected_build, $build); // -- Wrong type. self::expectErrorMessage('The input should be either instance of Drupal\Core\Cache\CacheableDependencyInterface or array. stdClass was given.'); diff --git a/tests/src/Kernel/EntityFormViewBuilderTest.php b/tests/src/Kernel/EntityFormViewBuilderTest.php index db74c26..bcb3d7d 100644 --- a/tests/src/Kernel/EntityFormViewBuilderTest.php +++ b/tests/src/Kernel/EntityFormViewBuilderTest.php @@ -3,7 +3,6 @@ namespace Drupal\Tests\twig_tweak\Kernel; use Drupal\Core\Cache\Cache; -use Drupal\KernelTests\KernelTestBase; use Drupal\Tests\user\Traits\UserCreationTrait; use Drupal\node\Entity\Node; use Drupal\node\Entity\NodeType; @@ -13,7 +12,7 @@ use Drupal\node\Entity\NodeType; * * @group twig_tweak */ -final class EntityFormViewBuilderTest extends KernelTestBase { +final class EntityFormViewBuilderTest extends AbstractTestCase { use UserCreationTrait; @@ -47,7 +46,7 @@ final class EntityFormViewBuilderTest extends KernelTestBase { /** * Test callback. */ - public function testEntityViewBuilder(): void { + public function testEntityFormViewBuilder(): void { $view_builder = $this->container->get('twig_tweak.entity_form_view_builder'); @@ -82,7 +81,7 @@ final class EntityFormViewBuilderTest extends KernelTestBase { ], 'max-age' => 50, ]; - self::assertSame($expected_cache, $build['#cache']); + self::assertCache($expected_cache, $build['#cache']); self::assertStringContainsString('