Commit 983e482f authored by catch's avatar catch
Browse files

Issue #3459754 by mondrake: Method getMockForAbstractClass() of class...

Issue #3459754 by mondrake: Method getMockForAbstractClass() of class PHPUnit\Framework\TestCase is deprecated in PHPUnit 10 - replace in class NormalizerBaseTest

(cherry picked from commit 8afa957b)
parent ac56748d
Loading
Loading
Loading
Loading
Loading
+0 −6
Original line number Diff line number Diff line
@@ -1609,12 +1609,6 @@
	'count' => 1,
	'path' => __DIR__ . '/modules/serialization/src/Normalizer/EntityNormalizer.php',
];
$ignoreErrors[] = [
	// identifier: method.deprecated
	'message' => '#^Call to deprecated method getMockForAbstractClass\\(\\) of class PHPUnit\\\\Framework\\\\TestCase\\.$#',
	'count' => 1,
	'path' => __DIR__ . '/modules/serialization/tests/src/Unit/Normalizer/NormalizerBaseTest.php',
];
$ignoreErrors[] = [
	// identifier: return.missing
	'message' => '#^Method Drupal\\\\shortcut\\\\Form\\\\SetCustomize\\:\\:save\\(\\) should return int but return statement is missing\\.$#',
+10 −3
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@ class NormalizerBaseTest extends UnitTestCase {
   *   (optional) The supported interface or class to set on the normalizer.
   */
  public function testSupportsNormalization($expected_return, $data, $supported_types = NULL): void {
    $normalizer_base = $this->getMockForAbstractClass('Drupal\Tests\serialization\Unit\Normalizer\TestNormalizerBase');
    $normalizer_base = new TestNormalizerBase();

    if (isset($supported_types)) {
      $normalizer_base->setSupportedTypes($supported_types);
@@ -61,9 +61,9 @@ public static function providerTestSupportsNormalization() {
}

/**
 * Test class for NormalizerBase.
 * Testable class for NormalizerBase.
 */
abstract class TestNormalizerBase extends NormalizerBase {
class TestNormalizerBase extends NormalizerBase {

  /**
   * The interface or class that this Normalizer supports.
@@ -89,4 +89,11 @@ public function getSupportedTypes(?string $format): array {
    return $this->supportedTypes;
  }

  /**
   * {@inheritdoc}
   */
  public function normalize($object, $format = NULL, array $context = []): array|string|int|float|bool|\ArrayObject|NULL {
    return NULL;
  }

}