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..1c774c4c82 100644
--- a/core/modules/serialization/tests/src/Unit/Normalizer/NormalizerBaseTest.php
+++ b/core/modules/serialization/tests/src/Unit/Normalizer/NormalizerBaseTest.php
@@ -61,6 +61,58 @@ public function providerTestSupportsNormalization() {
     ];
   }
 
+  /**
+   * Tests the supportsDenormalization method.
+   *
+   * @param bool $expected_return
+   *   The expected boolean return value from supportDenormalization.
+   * @param mixed $data
+   *   The data passed to supportsNormalization.
+   * @param string $supported_interface_or_class
+   *   (optional) The supported interface or class to set on the normalizer.
+   * @param array $supported_types
+   *   (optional) The supported data types to set on the normalizer.
+   *
+   * @dataProvider providerTestSupportsDenormalization
+   */
+  public function testSupportsDenormalization($expected_return, $data, $supported_interface_or_class = NULL, $supported_types = NULL) {
+    $normalizer_base = $this->getMockForAbstractClass(TestNormalizerBase::class);
+
+    if (!empty($supported_types)) {
+      $normalizer_base->setSupportedInterfaceOrClass($supported_types);
+    }
+
+    $this->assertSame($expected_return, $normalizer_base->supportsDenormalization($data, $supported_interface_or_class));
+  }
+
+  /**
+   * Data provider for testSupportsDenormalization.
+   *
+   * @return array
+   *   An array of provider data for testSupportsDenormalization.
+   */
+  public function providerTestSupportsDenormalization() {
+    $supported_types = [
+      1.10,
+      '123',
+      '1.13',
+    ];
+    return [
+      // If string '1.10' type is passed should return FALSE.
+      [FALSE, new \stdClass(), '1.10', $supported_types],
+      // If float 1.10 type is passed should return TRUE.
+      [TRUE, new \stdClass(), 1.10, $supported_types],
+      // If integer 123 is passed should return FALSE.
+      [FALSE, new \stdClass(), 123, $supported_types],
+      // If string '123' is passed should return TRUE.
+      [TRUE, new \stdClass(), '123', $supported_types],
+      // If float 1.13 is passed should return FALSE.
+      [FALSE, new \stdClass(), 1.13, $supported_types],
+      // If string '1.13' is passed should return TRUE.
+      [TRUE, new \stdClass(), '1.13', $supported_types],
+    ];
+  }
+
 }
 
 /**
