public function UniqueFieldAjaxTest::testUniqueTitleCustomMessage in Unique field ajax 2.x
Tests unique title custom message.
Throws
\Drupal\Core\Entity\EntityStorageException
\Behat\Mink\Exception\ResponseTextException
File
- tests/
src/ Functional/ UniqueFieldAjaxTest.php, line 215
Class
- UniqueFieldAjaxTest
- Test the field permissions report page.
Namespace
Drupal\Tests\unique_field_ajax\FunctionalCode
public function testUniqueTitleCustomMessage() {
// Create a random sentence.
$msg = $this
->createRandomData('sentence');
// With a custom message this is presented if errors.
$this
->updateThirdPartyEntitySetting('unique', TRUE);
$this
->updateThirdPartyEntitySetting('message', $msg);
$edit = $this
->createBasicUpdateData();
$this
->itCanSaveField($edit);
$this
->itCannotSaveField($edit, $msg, NULL, 'title');
// With a custom message this is presented if errors.
$this
->updateThirdPartyEntitySetting('unique', TRUE);
$this
->updateThirdPartyEntitySetting('message', '');
$edit = $this
->createBasicUpdateData();
$this
->itCanSaveField($edit);
$this
->itCannotSaveField($edit, NULL, NULL, 'title');
}