Issue #3086850 by MasterBranch, ravi.shankar, joachim, hchonov, kiwimind, mglaman, jhedstrom: "Cannot load a NULL ID" assertion in EntityStorageBase should say the entity type
parent
8b072d6d61
commit
c0f736b320
|
@ -246,7 +246,7 @@ abstract class EntityStorageBase extends EntityHandlerBase implements EntityStor
|
|||
* {@inheritdoc}
|
||||
*/
|
||||
public function load($id) {
|
||||
assert(!is_null($id), 'Cannot load a NULL ID.');
|
||||
assert(!is_null($id), sprintf('Cannot load the "%s" entity with NULL ID.', $this->entityTypeId));
|
||||
$entities = $this->loadMultiple([$id]);
|
||||
return isset($entities[$id]) ? $entities[$id] : NULL;
|
||||
}
|
||||
|
|
|
@ -564,7 +564,7 @@ class ConfigEntityStorageTest extends UnitTestCase {
|
|||
$this->assertSame('foo', $entity->id());
|
||||
|
||||
$this->expectException(\AssertionError::class);
|
||||
$this->expectExceptionMessage('Cannot load a NULL ID.');
|
||||
$this->expectExceptionMessage(sprintf('Cannot load the "%s" entity with NULL ID.', $this->entityTypeId));
|
||||
$this->entityStorage->load(NULL);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue