function PasswordItemTest::testPreSaveExistingNull
Same name in other branches
- 9 core/tests/Drupal/KernelTests/Core/Field/FieldType/PasswordItemTest.php \Drupal\KernelTests\Core\Field\FieldType\PasswordItemTest::testPreSaveExistingNull()
- 10 core/tests/Drupal/KernelTests/Core/Field/FieldType/PasswordItemTest.php \Drupal\KernelTests\Core\Field\FieldType\PasswordItemTest::testPreSaveExistingNull()
@covers ::preSave
File
-
core/
tests/ Drupal/ KernelTests/ Core/ Field/ FieldType/ PasswordItemTest.php, line 120
Class
- PasswordItemTest
- @coversDefaultClass \Drupal\Core\Field\Plugin\Field\FieldType\PasswordItem @group Field
Namespace
Drupal\KernelTests\Core\Field\FieldTypeCode
public function testPreSaveExistingNull() : void {
$entity = EntityTest::create();
$entity->test_field = $this->randomString();
$entity->save();
$this->assertNotNull($entity->test_field->value);
$entity->test_field = NULL;
$entity->save();
$this->assertNull($entity->test_field->value);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.