Skip to content

Commit f1a8ed2

Browse files
committed
x
1 parent 33fa873 commit f1a8ed2

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed

tests/Forms/Forms.submittedBy1.phpt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
/**
4+
* Test: Nette\Forms HTTP data.
5+
*/
6+
7+
declare(strict_types=1);
8+
9+
use Nette\Forms\Form;
10+
use Tester\Assert;
11+
12+
13+
require __DIR__ . '/../bootstrap.php';
14+
15+
16+
before(function () {
17+
$_SERVER['REQUEST_METHOD'] = 'POST';
18+
$_GET = $_POST = $_FILES = [];
19+
});

tests/Forms/Forms.submittedBy2.phpt

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
3+
/**
4+
* Test: Nette\Forms HTTP data.
5+
*/
6+
7+
declare(strict_types=1);
8+
9+
use Nette\Forms\Form;
10+
use Tester\Assert;
11+
12+
13+
require __DIR__ . '/../bootstrap.php';
14+
15+
16+
test(function () {
17+
$name = 'name';
18+
$_POST = [Form::TRACKER_ID => $name, 'send2' => ['x' => 1, 'y' => 1]];
19+
20+
$form = new Form($name);
21+
$btn1 = $form->addImage('send1');
22+
$btn2 = $form->addImage('send2');
23+
$btn3 = $form->addImage('send3');
24+
25+
Assert::true($form->isSuccess());
26+
Assert::same($btn2, $form->isSubmitted());
27+
});

0 commit comments

Comments
 (0)