function KeyValueEntityStorageTest::setUpMockUuidService

Reinitializes the UUID service as a mock object.

3 calls to KeyValueEntityStorageTest::setUpMockUuidService()
KeyValueEntityStorageTest::testCreate in core/tests/Drupal/Tests/Core/Entity/KeyValueStore/KeyValueEntityStorageTest.php
Tests create.
KeyValueEntityStorageTest::testCreateWithoutUuidKey in core/tests/Drupal/Tests/Core/Entity/KeyValueStore/KeyValueEntityStorageTest.php
Tests create without uuid key.
KeyValueEntityStorageTest::testCreateWithPredefinedUuid in core/tests/Drupal/Tests/Core/Entity/KeyValueStore/KeyValueEntityStorageTest.php
Tests create with predefined uuid.

File

core/tests/Drupal/Tests/Core/Entity/KeyValueStore/KeyValueEntityStorageTest.php, line 182

Class

KeyValueEntityStorageTest
Tests Drupal\Core\Entity\KeyValueStore\KeyValueEntityStorage.

Namespace

Drupal\Tests\Core\Entity\KeyValueStore

Code

protected function setUpMockUuidService() : void {
  $this->uuidService = $this->createMock(UuidInterface::class);
  $reflection = new \ReflectionProperty($this->entityStorage, 'uuidService');
  $reflection->setValue($this->entityStorage, $this->uuidService);
}

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