diff --git a/tests/src/Functional/TwigTweakTest.php b/tests/src/Functional/TwigTweakTest.php index 2f70966..a2391cd 100644 --- a/tests/src/Functional/TwigTweakTest.php +++ b/tests/src/Functional/TwigTweakTest.php @@ -269,14 +269,14 @@ final class TwigTweakTest extends BrowserTestBase { $url = Url::fromUserInput('/node/1/edit', ['absolute' => TRUE]); $link = Link::fromTextAndUrl('Edit', $url)->toString(); $xpath = '//div[@class = "tt-link"]'; - self::assertEquals($link, $this->xpath($xpath)[0]->getHtml()); + self::assertSame((string) $link, $this->xpath($xpath)[0]->getHtml()); // -- Link with HTML. $text = Markup::create('Edit'); $url = Url::fromUserInput('/node/1/edit', ['absolute' => TRUE]); $link = Link::fromTextAndUrl($text, $url)->toString(); $xpath = '//div[@class = "tt-link-html"]'; - self::assertEquals($link, $this->xpath($xpath)[0]->getHtml()); + self::assertSame((string) $link, $this->xpath($xpath)[0]->getHtml()); // -- Status messages. $xpath = '//div[@class = "tt-messages"]//div[contains(@class, "messages--status") and contains(., "Hello world!")]'; diff --git a/tests/src/Kernel/AbstractExtractorTestCase.php b/tests/src/Kernel/AbstractExtractorTestCase.php index f21b15d..af83a52 100644 --- a/tests/src/Kernel/AbstractExtractorTestCase.php +++ b/tests/src/Kernel/AbstractExtractorTestCase.php @@ -50,6 +50,7 @@ abstract class AbstractExtractorTestCase extends KernelTestBase { $this->installConfig(['node', 'twig_tweak_test']); $this->installSchema('file', 'file_usage'); + $this->installEntitySchema('user'); $this->installEntitySchema('file'); $this->installEntitySchema('media'); diff --git a/tests/src/Kernel/CacheMetadataExtractorTest.php b/tests/src/Kernel/CacheMetadataExtractorTest.php index ed3f5c6..23ebc05 100644 --- a/tests/src/Kernel/CacheMetadataExtractorTest.php +++ b/tests/src/Kernel/CacheMetadataExtractorTest.php @@ -90,7 +90,8 @@ final class CacheMetadataExtractorTest extends AbstractTestCase { 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.'); + $exception = new \InvalidArgumentException('The input should be either instance of Drupal\Core\Cache\CacheableDependencyInterface or array. stdClass was given.'); + self::expectExceptionObject($exception); /* @noinspection PhpParamsInspection */ $extractor->extractCacheMetadata(new \stdClass()); }