protected function EntityTestDateonlyTest::createEntity in Drupal 10
Same name and namespace in other branches
- 8 core/modules/datetime/tests/src/Functional/EntityResource/EntityTest/EntityTestDateonlyTest.php \Drupal\Tests\datetime\Functional\EntityResource\EntityTest\EntityTestDateonlyTest::createEntity()
 - 9 core/modules/datetime/tests/src/Functional/EntityResource/EntityTest/EntityTestDateonlyTest.php \Drupal\Tests\datetime\Functional\EntityResource\EntityTest\EntityTestDateonlyTest::createEntity()
 
File
- core/
modules/ datetime/ tests/ src/ Functional/ EntityResource/ EntityTest/ EntityTestDateonlyTest.php, line 79  
Class
- EntityTestDateonlyTest
 - Tests the datetime field constraint with 'date' items.
 
Namespace
Drupal\Tests\datetime\Functional\EntityResource\EntityTestCode
protected function createEntity() {
  $entity_test = EntityTest::create([
    'name' => 'Llama',
    'type' => static::$entityTypeId,
    static::$fieldName => static::$dateString,
  ]);
  $entity_test
    ->setOwnerId(0);
  $entity_test
    ->save();
  return $entity_test;
}