Skip to content

Commit b10e0c0

Browse files
committed
x
1 parent 61e0cc7 commit b10e0c0

File tree

3 files changed

+47
-1
lines changed

3 files changed

+47
-1
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- travis_retry composer update --no-progress --prefer-dist --prefer-lowest --prefer-stable
2525

2626

27-
- stage: Code Standard Checker
27+
- env: title="CS"
2828
php: 7.1
2929
install:
3030
# Install Nette Code Checker

tests/Forms/Forms.submittedBy1.phpt

+19
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

+27
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)