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. 8.9.x core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityStorageTest.php \Drupal\Tests\Core\Config\Entity\ConfigEntityStorageTest::getMockEntity()
  3. 10 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\Config\Entity\ConfigEntityInterface&\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 700

Class

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

Namespace

Drupal\Tests\Core\Config\Entity

Code

public function getMockEntity(array $values = [], array $methods = []) : ConfigEntityInterface&MockObject {
    return $this->getMockBuilder(StubConfigEntity::class)
        ->setConstructorArgs([
        $values,
        'test_entity_type',
    ])
        ->onlyMethods($methods)
        ->getMock();
}

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