function EntityTestDatetimeTest::createEntity
Same name in other branches
- 9 core/modules/datetime/tests/src/Functional/EntityResource/EntityTest/EntityTestDatetimeTest.php \Drupal\Tests\datetime\Functional\EntityResource\EntityTest\EntityTestDatetimeTest::createEntity()
- 8.9.x core/modules/datetime/tests/src/Functional/EntityResource/EntityTest/EntityTestDatetimeTest.php \Drupal\Tests\datetime\Functional\EntityResource\EntityTest\EntityTestDatetimeTest::createEntity()
- 10 core/modules/datetime/tests/src/Functional/EntityResource/EntityTest/EntityTestDatetimeTest.php \Drupal\Tests\datetime\Functional\EntityResource\EntityTest\EntityTestDatetimeTest::createEntity()
Overrides EntityTestResourceTestBase::createEntity
File
-
core/
modules/ datetime/ tests/ src/ Functional/ EntityResource/ EntityTest/ EntityTestDatetimeTest.php, line 81
Class
- EntityTestDatetimeTest
- Tests the datetime field constraint with 'datetime' 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;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.