Skip to content

Commit

Permalink
tests: fix build against latest nette/forms
Browse files Browse the repository at this point in the history
  • Loading branch information
xificurk committed Apr 17, 2021
1 parent 88929de commit 117d74f
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions tests/BirthNumberInput/BirthNumberInputTest.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class BirthNumberInputTest extends TestCase
$this->resetHttpGlobalVariables();
$_POST['birthNumber'] = '';

$form = new Form();
$form = $this->createForm();
$birthNumberInput = new BirthNumberInput();
$form['birthNumber'] = $birthNumberInput;
$form->fireEvents();
Expand All @@ -91,7 +91,7 @@ class BirthNumberInputTest extends TestCase
$this->resetHttpGlobalVariables();
$_POST['birthNumber'] = '/';

$form = new Form();
$form = $this->createForm();
$birthNumberInput = new BirthNumberInput();
$form['birthNumber'] = $birthNumberInput;
$birthNumberInput->setEmptyValue('/');
Expand All @@ -112,7 +112,7 @@ class BirthNumberInputTest extends TestCase
$this->resetHttpGlobalVariables();
$_POST['birthNumber'] = '000101 / 0009';

$form = new Form();
$form = $this->createForm();
$birthNumberInput = new BirthNumberInput();
$form['birthNumber'] = $birthNumberInput;
$form->fireEvents();
Expand All @@ -133,7 +133,7 @@ class BirthNumberInputTest extends TestCase
$this->resetHttpGlobalVariables();
$_POST['birthNumber'] = '000101 / 0000';

$form = new Form();
$form = $this->createForm();
$birthNumberInput = new BirthNumberInput();
$form['birthNumber'] = $birthNumberInput;
$birthNumberInput->setRequired('true');
Expand All @@ -157,6 +157,14 @@ class BirthNumberInputTest extends TestCase
$_GET = [];
}

private function createForm(): Form
{
$form = new Form();
$form->onSubmit[] = function (): void {
};
return $form;
}

}


Expand Down

0 comments on commit 117d74f

Please sign in to comment.