protected function EntityUsageTest::getTestEntities in Entity Usage 8
Same name and namespace in other branches
- 8.4 tests/src/Kernel/EntityUsageTest.php \Drupal\Tests\entity_usage\Kernel\EntityUsageTest::getTestEntities()
- 8.2 tests/src/Kernel/EntityUsageTest.php \Drupal\Tests\entity_usage\Kernel\EntityUsageTest::getTestEntities()
- 8.3 tests/src/Kernel/EntityUsageTest.php \Drupal\Tests\entity_usage\Kernel\EntityUsageTest::getTestEntities()
Creates two test entities.
Return value
array An array of entity objects.
1 call to EntityUsageTest::getTestEntities()
- EntityUsageTest::setUp in tests/
src/ Kernel/ EntityUsageTest.php
File
- tests/
src/ Kernel/ EntityUsageTest.php, line 335
Class
- EntityUsageTest
- Tests the basic API operations of our tracking service..
Namespace
Drupal\Tests\entity_usage\KernelCode
protected function getTestEntities() {
$content_entity_1 = EntityTest::create([
'name' => $this
->randomMachineName(),
]);
$content_entity_1
->save();
$content_entity_2 = EntityTest::create([
'name' => $this
->randomMachineName(),
]);
$content_entity_2
->save();
return [
$content_entity_1,
$content_entity_2,
];
}