public function UniqueFieldAjaxTest::testUniqueFieldEnabledRequiredUniqueness in Unique field ajax 2.x
Test if field enabled uniqueness is required we get errors.
Throws
\Drupal\Core\Entity\EntityStorageException
\Behat\Mink\Exception\ResponseTextException
File
- tests/
src/ Functional/ UniqueFieldAjaxTest.php, line 39
Class
- UniqueFieldAjaxTest
- Test the field permissions report page.
Namespace
Drupal\Tests\unique_field_ajax\FunctionalCode
public function testUniqueFieldEnabledRequiredUniqueness() {
foreach ($this->fieldTypes as $field_type) {
$this
->createField($field_type['type'], $field_type['widget'], $field_type['settings']);
$field_name = $this->fieldStorage
->getName();
// Field enabled requires value to be unique.
// We create a new one and then try to create another which should fail.
$this
->updateThirdPartyFieldSetting('unique', TRUE);
$edit = $this
->createUpdateFieldData($field_name, $field_type['value'], $field_type['effect']);
$this
->itCanSaveField($edit);
$this
->itCannotSaveField($edit);
}
}