new system-config to prevent overlapping records (#1720)
This commit is contained in:
@@ -217,16 +217,15 @@ abstract class ControllerBaseTest extends WebTestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $role the USER role to use for the request
|
||||
* @param HttpKernelBrowser $client the client to use
|
||||
* @param string $url the URL of the page displaying the initial form to submit
|
||||
* @param string $formSelector a selector to find the form to test
|
||||
* @param array $formData values to fill in the form
|
||||
* @param array $fieldNames array of form-fields that should fail
|
||||
* @param bool $disableValidation whether the form should validate before submitting or not
|
||||
*/
|
||||
protected function assertFormHasValidationError($role, $url, $formSelector, array $formData, array $fieldNames, $disableValidation = true)
|
||||
protected function assertHasValidationError(HttpKernelBrowser $client, $url, $formSelector, array $formData, array $fieldNames, $disableValidation = true)
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser($role);
|
||||
$crawler = $client->request('GET', $this->createUrl($url));
|
||||
$form = $crawler->filter($formSelector)->form();
|
||||
if ($disableValidation) {
|
||||
@@ -260,6 +259,20 @@ abstract class ControllerBaseTest extends WebTestCase
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $role the USER role to use for the request
|
||||
* @param string $url the URL of the page displaying the initial form to submit
|
||||
* @param string $formSelector a selector to find the form to test
|
||||
* @param array $formData values to fill in the form
|
||||
* @param array $fieldNames array of form-fields that should fail
|
||||
* @param bool $disableValidation whether the form should validate before submitting or not
|
||||
*/
|
||||
protected function assertFormHasValidationError($role, $url, $formSelector, array $formData, array $fieldNames, $disableValidation = true)
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser($role);
|
||||
$this->assertHasValidationError($client, $url, $formSelector, $formData, $fieldNames, $disableValidation);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param HttpKernelBrowser $client
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user