You are here

public function KeyValueEntityStorageTest::testLoadMissingEntity in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/tests/Drupal/Tests/Core/Entity/KeyValueStore/KeyValueEntityStorageTest.php \Drupal\Tests\Core\Entity\KeyValueStore\KeyValueEntityStorageTest::testLoadMissingEntity()

@covers ::load

File

core/tests/Drupal/Tests/Core/Entity/KeyValueStore/KeyValueEntityStorageTest.php, line 517
Contains \Drupal\Tests\Core\Entity\KeyValueStore\KeyValueEntityStorageTest.

Class

KeyValueEntityStorageTest
@coversDefaultClass \Drupal\Core\Entity\KeyValueStore\KeyValueEntityStorage @group Entity

Namespace

Drupal\Tests\Core\Entity\KeyValueStore

Code

public function testLoadMissingEntity() {
  $this->entityType
    ->expects($this
    ->once())
    ->method('getClass');
  $this
    ->setUpKeyValueEntityStorage();
  $this->keyValueStore
    ->expects($this
    ->once())
    ->method('getMultiple')
    ->with(array(
    'foo',
  ))
    ->will($this
    ->returnValue(array()));
  $this->moduleHandler
    ->expects($this
    ->never())
    ->method('getImplementations');
  $entity = $this->entityStorage
    ->load('foo');
  $this
    ->assertNull($entity);
}