function PasswordItemTest::testPreSaveExistingMultipleSpacesString

Same name and namespace in other branches
  1. 10 core/tests/Drupal/KernelTests/Core/Field/FieldType/PasswordItemTest.php \Drupal\KernelTests\Core\Field\FieldType\PasswordItemTest::testPreSaveExistingMultipleSpacesString()
  2. 9 core/tests/Drupal/KernelTests/Core/Field/FieldType/PasswordItemTest.php \Drupal\KernelTests\Core\Field\FieldType\PasswordItemTest::testPreSaveExistingMultipleSpacesString()

Tests pre save existing multiple spaces string.

File

core/tests/Drupal/KernelTests/Core/Field/FieldType/PasswordItemTest.php, line 158

Class

PasswordItemTest
Tests Drupal\Core\Field\Plugin\Field\FieldType\PasswordItem.

Namespace

Drupal\KernelTests\Core\Field\FieldType

Code

public function testPreSaveExistingMultipleSpacesString() : void {
  $entity = EntityTest::create();
  $entity->test_field = $this->randomString();
  $entity->save();
  $entity->test_field = '     ';
  $entity->save();
  // @todo Fix this bug in https://www.drupal.org/project/drupal/issues/3238399.
  $this->assertSame('     ', $entity->test_field->value);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.