Skip to content
Snippets Groups Projects
Unverified Commit 21b6e13c authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3474978 by mondrake, quietone: Method getMockForAbstractClass() is...

Issue #3474978 by mondrake, quietone: Method getMockForAbstractClass() is deprecated - replace in class KeyValueEntityStorageTest
parent bed6f440
No related branches found
No related tags found
13 merge requests!11131[10.4.x-only-DO-NOT-MERGE]: Issue ##2842525 Ajax attached to Views exposed filter form does not trigger callbacks,!3878Removed unused condition head title for views,!3818Issue #2140179: $entity->original gets stale between updates,!3154Fixes #2987987 - CSRF token validation broken on routes with optional parameters.,!3133core/modules/system/css/components/hidden.module.css,!2964Issue #2865710 : Dependencies from only one instance of a widget are used in display modes,!2812Issue #3312049: [Followup] Fix Drupal.Commenting.FunctionComment.MissingReturnType returns for NULL,!2062Issue #3246454: Add weekly granularity to views date sort,!10223132456: Fix issue where views instances are emptied before an ajax request is complete,!617Issue #3043725: Provide a Entity Handler for user cancelation,!579Issue #2230909: Simple decimals fail to pass validation,!560Move callback classRemove outside of the loop,!555Issue #3202493
Pipeline #320948 passed with warnings
Pipeline: drupal

#320949

    ......@@ -69717,12 +69717,6 @@
    'count' => 1,
    'path' => __DIR__ . '/tests/Drupal/Tests/Core/Entity/FieldDefinitionTest.php',
    ];
    $ignoreErrors[] = [
    // identifier: method.deprecated
    'message' => '#^Call to deprecated method getMockForAbstractClass\\(\\) of class PHPUnit\\\\Framework\\\\TestCase\\.$#',
    'count' => 1,
    'path' => __DIR__ . '/tests/Drupal/Tests/Core/Entity/KeyValueStore/KeyValueEntityStorageTest.php',
    ];
    $ignoreErrors[] = [
    // identifier: missingType.return
    'message' => '#^Method Drupal\\\\Tests\\\\Core\\\\Entity\\\\KeyValueStore\\\\KeyValueEntityStorageTest\\:\\:testSaveConfigEntity\\(\\) has no return type specified\\.$#',
    ......@@ -14,9 +14,10 @@
    use Drupal\Core\Entity\EntityMalformedException;
    use Drupal\Core\Entity\EntityStorageException;
    use Drupal\Core\Entity\EntityTypeManagerInterface;
    use Drupal\Core\Entity\KeyValueStore\KeyValueEntityStorage;
    use Drupal\Core\Language\Language;
    use Drupal\Tests\UnitTestCase;
    use Drupal\Core\Entity\KeyValueStore\KeyValueEntityStorage;
    use PHPUnit\Framework\MockObject\MockObject;
    /**
    * @coversDefaultClass \Drupal\Core\Entity\KeyValueStore\KeyValueEntityStorage
    ......@@ -604,17 +605,17 @@ public function testDeleteNothing(): void {
    * Creates an entity with specific methods mocked.
    *
    * @param string $class
    * (optional) The concrete entity class to mock. Defaults to
    * 'Drupal\Core\Entity\EntityBase'.
    * (optional) The concrete entity class to mock. Defaults to a stub of
    * \Drupal\Core\Entity\EntityBase defined for test purposes.
    * @param array $arguments
    * (optional) Arguments to pass to the constructor. An empty set of values
    * and an entity type ID will be provided.
    * @param array $methods
    * (optional) The methods to mock.
    *
    * @return \Drupal\Core\Entity\EntityInterface|\PHPUnit\Framework\MockObject\MockObject
    * @return \Drupal\Core\Entity\EntityInterface&\PHPUnit\Framework\MockObject\MockObject
    */
    public function getMockEntity($class = EntityBaseTest::class, array $arguments = [], $methods = []) {
    protected function getMockEntity(string $class = EntityBaseTest::class, array $arguments = [], array $methods = []): EntityInterface&MockObject {
    // Ensure the entity is passed at least an array of values and an entity
    // type ID
    if (!isset($arguments[0])) {
    ......@@ -623,7 +624,10 @@ public function getMockEntity($class = EntityBaseTest::class, array $arguments =
    if (!isset($arguments[1])) {
    $arguments[1] = 'test_entity_type';
    }
    return $this->getMockForAbstractClass($class, $arguments, '', TRUE, TRUE, TRUE, $methods);
    return $this->getMockBuilder($class)
    ->setConstructorArgs($arguments)
    ->onlyMethods($methods)
    ->getMock();
    }
    }
    ......
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Please register or to comment