diff --git a/core/modules/system/src/Tests/Entity/EntityUUIDTest.php b/core/modules/system/src/Tests/Entity/EntityUUIDTest.php index 9108256..d34fffe 100644 --- a/core/modules/system/src/Tests/Entity/EntityUUIDTest.php +++ b/core/modules/system/src/Tests/Entity/EntityUUIDTest.php @@ -100,5 +100,11 @@ protected function assertCRUD($entity_type) { } $entity_duplicate->save(); $this->assertNotEqual($entity->id(), $entity_duplicate->id()); + + // Verify that \Drupal::entityManager()->loadEntityByUuid() returns NULL + // for a non-existent UUID. + $non_existent_uuid = \Drupal::service('uuid')->generate(); + $non_existent_entity = \Drupal::entityManager()->loadEntityByUuid($entity_type, $non_existent_uuid); + $this->assertNull($non_existent_entity); } }