function KeyValueEntityStorageTest::testLoadMissingEntity

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Core/Entity/KeyValueStore/KeyValueEntityStorageTest.php \Drupal\Tests\Core\Entity\KeyValueStore\KeyValueEntityStorageTest::testLoadMissingEntity()
  2. 10 core/tests/Drupal/Tests/Core/Entity/KeyValueStore/KeyValueEntityStorageTest.php \Drupal\Tests\Core\Entity\KeyValueStore\KeyValueEntityStorageTest::testLoadMissingEntity()
  3. 11.x 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 525

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([
        'foo',
    ])
        ->will($this->returnValue([]));
    $this->moduleHandler
        ->expects($this->never())
        ->method('getImplementations');
    $entity = $this->entityStorage
        ->load('foo');
    $this->assertNull($entity);
}

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