From 84bd359419a75b149733c753c64fedad1fa4f885 Mon Sep 17 00:00:00 2001 From: Alex Pott Date: Thu, 23 Jul 2020 14:43:38 +0100 Subject: [PATCH] Issue #3159739 by jungle, Beakerboy, daffie: Avoid directly comparing string to blob in EntityDisplayTest (cherry picked from commit 9346c2ff9be8d3a4bc4696151fc1c2a0ff324970) --- .../field_ui/tests/src/Kernel/EntityDisplayTest.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/core/modules/field_ui/tests/src/Kernel/EntityDisplayTest.php b/core/modules/field_ui/tests/src/Kernel/EntityDisplayTest.php index d53aa992c0..49a30f8b4d 100644 --- a/core/modules/field_ui/tests/src/Kernel/EntityDisplayTest.php +++ b/core/modules/field_ui/tests/src/Kernel/EntityDisplayTest.php @@ -638,14 +638,13 @@ public function testComponentDependencies() { $this->assertTrue($form_display->get('hidden')[$field_name]); // The correct warning message has been logged. $arguments = ['@display' => (string) t('Entity form display'), '@id' => $form_display->id(), '@name' => $field_name]; - $logged = (bool) Database::getConnection()->select('watchdog', 'w') - ->fields('w', ['wid']) + $variables = Database::getConnection()->select('watchdog', 'w') + ->fields('w', ['variables']) ->condition('type', 'system') ->condition('message', "@display '@id': Component '@name' was disabled because its settings depend on removed dependencies.") - ->condition('variables', serialize($arguments)) ->execute() - ->fetchAll(); - $this->assertTrue($logged); + ->fetchField(); + $this->assertEquals($arguments, unserialize($variables)); } /** -- GitLab