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