public function EntityLoadHelperTest::testLoadEntityDoesntSearchTwiceIfUuidIsProvided in YAML Content 8
An entity is not searched by properties if UUID is provided.
@covers ::loadEntity
File
- tests/
src/ Unit/ EntityLoadHelper/ EntityLoadHelperTest.php, line 171
Class
- EntityLoadHelperTest
- Test functionality of the EntityLoadHelper class.
Namespace
Drupal\Tests\yaml_content\Unit\EntityLoadHelperCode
public function testLoadEntityDoesntSearchTwiceIfUuidIsProvided() {
$this->loadHelper = $this
->getEntityLoadHelperMock([
'loadByUuid',
'loadByProperties',
]);
// Prepare the parameters.
$entity_type = 'test_entity';
$content_data = [
'entity' => 'test_entity',
// Include a UUID property.
'uuid' => '3c6485e4-69a3-429d-8ab1-3e7df48747bc',
];
$this->loadHelper
->expects($this
->never())
->method('loadByProperties');
// Execute the method.
$this->loadHelper
->loadEntity($entity_type, $content_data);
}