// Ensure the hidden 'form_build_id' field is unique.
$this->
assertSession()->
elementsCount('xpath', '//input[@name="form_build_id"]', 1
);
$buildId =
$this->
assertSession()->
hiddenFieldExists('form_build_id'
)->
getValue();
// Trigger validation error by submitting an empty title.
$edit =
['title' => ''
];
$this->
submitForm($edit, 'Continue submit'
);
// Verify that the build-id did change.
$this->
assertSession()->
hiddenFieldValueNotEquals('form_build_id',
$buildId);
// Ensure the hidden 'form_build_id' field is unique.
$this->
assertSession()->
elementsCount('xpath', '//input[@name="form_build_id"]', 1
);
// Retrieve the new build-id.
$buildId =
(string) $this->
assertSession()->
hiddenFieldExists('form_build_id'
)->
getValue();
// Trigger validation error by again submitting an empty title.
$edit =
['title' => ''
];
$this->
submitForm($edit, 'Continue submit'
);