diff --git a/core/modules/serialization/src/Normalizer/NormalizerBase.php b/core/modules/serialization/src/Normalizer/NormalizerBase.php
index 8779b1a1b6..c796ab834d 100644
--- a/core/modules/serialization/src/Normalizer/NormalizerBase.php
+++ b/core/modules/serialization/src/Normalizer/NormalizerBase.php
@@ -60,7 +60,7 @@ public function supportsDenormalization($data, $type, $format = NULL) {
       return (class_exists($name) || interface_exists($name)) && is_subclass_of($type, $name, TRUE);
     };
 
-    return in_array($type, $supported) || array_filter($supported, $subclass_check);
+    return in_array($type, $supported, TRUE) || array_filter($supported, $subclass_check);
   }
 
   /**
diff --git a/core/modules/serialization/tests/src/Unit/Normalizer/NormalizerBaseTest.php b/core/modules/serialization/tests/src/Unit/Normalizer/NormalizerBaseTest.php
index 63b9bf714d..e38e92a6fe 100644
--- a/core/modules/serialization/tests/src/Unit/Normalizer/NormalizerBaseTest.php
+++ b/core/modules/serialization/tests/src/Unit/Normalizer/NormalizerBaseTest.php
@@ -61,6 +61,56 @@ public function providerTestSupportsNormalization() {
     ];
   }
 
+  /**
+   * Tests the supportsDenormalization method.
+   *
+   * @param bool $expected_return
+   *   The expected boolean return value from supportDenormalization.
+   * @param string|int|float $type
+   *   An interface, class or value to check for denormalization support.
+   * @param string|string[] $format
+   *   (optional) An interface, class or value the denormalization is supported
+   *   for.
+   *
+   * @dataProvider providerTestSupportsDenormalization
+   */
+  public function testSupportsDenormalization($expected_return, $type, $format = NULL) {
+    /** @var \Drupal\Tests\serialization\Unit\Normalizer\TestNormalizerBase $normalizer_base */
+    $normalizer_base = $this->getMockForAbstractClass(TestNormalizerBase::class);
+
+    if (isset($format)) {
+      $normalizer_base->setSupportedInterfaceOrClass($format);
+    }
+
+    $this->assertSame($expected_return, $normalizer_base->supportsDenormalization(NULL, $type));
+  }
+
+  /**
+   * Data provider for testSupportsDenormalization.
+   *
+   * @return array[]
+   *   An array of provider data for testSupportsDenormalization.
+   */
+  public function providerTestSupportsDenormalization() {
+    $formats = [
+      1.10,
+      '123',
+      '1.13',
+      // @todo This should fail since the class is missing.
+      'Ns\Of\MissingClass',
+    ];
+
+    return [
+      [FALSE, '1.10', $formats],
+      [TRUE, 1.10, $formats],
+      [FALSE, 123, $formats],
+      [TRUE, '123', $formats],
+      [FALSE, 1.13, $formats],
+      [TRUE, '1.13', $formats],
+      [TRUE, 'Ns\Of\MissingClass', $formats],
+    ];
+  }
+
 }
 
 /**
