function ConfigEntityStorageTest::getMockEntity

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityStorageTest.php \Drupal\Tests\Core\Config\Entity\ConfigEntityStorageTest::getMockEntity()
  2. 10 core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityStorageTest.php \Drupal\Tests\Core\Config\Entity\ConfigEntityStorageTest::getMockEntity()
  3. 11.x core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityStorageTest.php \Drupal\Tests\Core\Config\Entity\ConfigEntityStorageTest::getMockEntity()

Creates an entity with specific methods mocked.

Parameters

array $values: (optional) Values to pass to the constructor.

array $methods: (optional) The methods to mock.

Return value

\Drupal\Core\Entity\EntityInterface|\PHPUnit\Framework\MockObject\MockObject

9 calls to ConfigEntityStorageTest::getMockEntity()
ConfigEntityStorageTest::setUp in core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityStorageTest.php
@covers ::__construct
ConfigEntityStorageTest::testCreate in core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityStorageTest.php
@covers ::create @covers ::doCreate
ConfigEntityStorageTest::testCreateWithPredefinedUuid in core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityStorageTest.php
@covers ::create @covers ::doCreate
ConfigEntityStorageTest::testDelete in core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityStorageTest.php
@covers ::delete @covers ::doDelete
ConfigEntityStorageTest::testSaveChangedUuid in core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityStorageTest.php
@covers ::save @covers ::doSave

... See full list

File

core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityStorageTest.php, line 725

Class

ConfigEntityStorageTest
@coversDefaultClass \Drupal\Core\Config\Entity\ConfigEntityStorage @group Config

Namespace

Drupal\Tests\Core\Config\Entity

Code

public function getMockEntity(array $values = [], $methods = []) {
    return $this->getMockForAbstractClass(ConfigEntityBase::class, [
        $values,
        'test_entity_type',
    ], '', TRUE, TRUE, TRUE, $methods);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.