public function BaseFieldDefinitionTest::testFieldStorageRequired in Drupal 10
Same name and namespace in other branches
- 8 core/tests/Drupal/Tests/Core/Entity/BaseFieldDefinitionTest.php \Drupal\Tests\Core\Entity\BaseFieldDefinitionTest::testFieldStorageRequired()
- 9 core/tests/Drupal/Tests/Core/Entity/BaseFieldDefinitionTest.php \Drupal\Tests\Core\Entity\BaseFieldDefinitionTest::testFieldStorageRequired()
Tests storage required.
@covers ::isStorageRequired @covers ::setStorageRequired
File
- core/
tests/ Drupal/ Tests/ Core/ Entity/ BaseFieldDefinitionTest.php, line 312
Class
- BaseFieldDefinitionTest
- Unit test for BaseFieldDefinition.
Namespace
Drupal\Tests\Core\EntityCode
public function testFieldStorageRequired() {
$definition = BaseFieldDefinition::create($this->fieldType);
$this
->assertFalse($definition
->isStorageRequired());
$definition
->setStorageRequired(TRUE);
$this
->assertTrue($definition
->isStorageRequired());
$definition
->setStorageRequired(FALSE);
$this
->assertFalse($definition
->isStorageRequired());
}