Skip to content

Commit f85c2ec

Browse files
committed
tests: test() with description
1 parent 7d0112d commit f85c2ec

File tree

52 files changed

+392
-392
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+392
-392
lines changed

tests/Forms.DI/FormsExtension.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use Tester\Assert;
1616
require __DIR__ . '/../bootstrap.php';
1717

1818

19-
test(function () {
19+
test('', function () {
2020
$compiler = new DI\Compiler;
2121
$compiler->addExtension('forms', new FormsExtension);
2222

tests/Forms/Container.values.ArrayHash.phpt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function createForm(): Form
3636
}
3737

3838

39-
test(function () { // setDefaults() + iterable
39+
test('setDefaults() + iterable', function () {
4040
$form = createForm();
4141
Assert::false($form->isSubmitted());
4242

@@ -65,7 +65,7 @@ test(function () { // setDefaults() + iterable
6565
});
6666

6767

68-
test(function () { // submitted form + getValues()
68+
test('submitted form + getValues()', function () {
6969
$_SERVER['REQUEST_METHOD'] = 'POST';
7070

7171
$form = createForm();
@@ -83,7 +83,7 @@ test(function () { // submitted form + getValues()
8383
});
8484

8585

86-
test(function () { // submitted form + reset()
86+
test('submitted form + reset()', function () {
8787
$_SERVER['REQUEST_METHOD'] = 'POST';
8888

8989
$form = createForm();
@@ -105,7 +105,7 @@ test(function () { // submitted form + reset()
105105
});
106106

107107

108-
test(function () { // setValues() + iterable
108+
test('setValues() + iterable', function () {
109109
$_SERVER['REQUEST_METHOD'] = 'POST';
110110

111111
$form = createForm();
@@ -150,7 +150,7 @@ test(function () { // setValues() + iterable
150150
});
151151

152152

153-
test(function () { // onSuccess test
153+
test('onSuccess test', function () {
154154
$_SERVER['REQUEST_METHOD'] = 'POST';
155155

156156
$form = createForm();

tests/Forms/Container.values.array.phpt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function createForm(): Form
3636
}
3737

3838

39-
test(function () { // setDefaults() + array
39+
test('setDefaults() + array', function () {
4040
$form = createForm();
4141
Assert::false($form->isSubmitted());
4242

@@ -65,7 +65,7 @@ test(function () { // setDefaults() + array
6565
});
6666

6767

68-
test(function () { // submitted form + getValues(true)
68+
test('submitted form + getValues(true)', function () {
6969
$_SERVER['REQUEST_METHOD'] = 'POST';
7070

7171
$form = createForm();
@@ -83,7 +83,7 @@ test(function () { // submitted form + getValues(true)
8383
});
8484

8585

86-
test(function () { // submitted form + reset()
86+
test('submitted form + reset()', function () {
8787
$_SERVER['REQUEST_METHOD'] = 'POST';
8888

8989
$form = createForm();
@@ -105,7 +105,7 @@ test(function () { // submitted form + reset()
105105
});
106106

107107

108-
test(function () { // setValues() + array
108+
test('setValues() + array', function () {
109109
$_SERVER['REQUEST_METHOD'] = 'POST';
110110

111111
$form = createForm();
@@ -150,7 +150,7 @@ test(function () { // setValues() + array
150150
});
151151

152152

153-
test(function () { // getValues(...arguments...)
153+
test('getValues(...arguments...)', function () {
154154
$_SERVER['REQUEST_METHOD'] = 'POST';
155155

156156
$form = createForm();
@@ -177,7 +177,7 @@ test(function () { // getValues(...arguments...)
177177
});
178178

179179

180-
test(function () { // setMappedType(array)
180+
test('setMappedType(array)', function () {
181181
$_SERVER['REQUEST_METHOD'] = 'POST';
182182

183183
$form = createForm();
@@ -205,7 +205,7 @@ test(function () { // setMappedType(array)
205205
});
206206

207207

208-
test(function () { // onSuccess test
208+
test('onSuccess test', function () {
209209
$_SERVER['REQUEST_METHOD'] = 'POST';
210210

211211
$form = createForm();

tests/Forms/Container.values.mapping.74.phpt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ function createForm(): Form
7979
}
8080

8181

82-
test(function () { // setDefaults() + object
82+
test('setDefaults() + object', function () {
8383
$form = createForm();
8484
Assert::false($form->isSubmitted());
8585

@@ -108,7 +108,7 @@ test(function () { // setDefaults() + object
108108
});
109109

110110

111-
test(function () { // submitted form + getValues()
111+
test('submitted form + getValues()', function () {
112112
$_SERVER['REQUEST_METHOD'] = 'POST';
113113

114114
$form = createForm();
@@ -128,7 +128,7 @@ test(function () { // submitted form + getValues()
128128
});
129129

130130

131-
test(function () { // submitted form + reset()
131+
test('submitted form + reset()', function () {
132132
$_SERVER['REQUEST_METHOD'] = 'POST';
133133

134134
$form = createForm();
@@ -152,7 +152,7 @@ test(function () { // submitted form + reset()
152152
});
153153

154154

155-
test(function () { // setValues() + object
155+
test('setValues() + object', function () {
156156
$_SERVER['REQUEST_METHOD'] = 'POST';
157157

158158
$form = createForm();
@@ -200,7 +200,7 @@ test(function () { // setValues() + object
200200
});
201201

202202

203-
test(function () { // getValues(...arguments...)
203+
test('getValues(...arguments...)', function () {
204204
$_SERVER['REQUEST_METHOD'] = null;
205205

206206
$form = createForm();
@@ -252,7 +252,7 @@ test(function () { // getValues(...arguments...)
252252
});
253253

254254

255-
test(function () { // onSuccess test
255+
test('onSuccess test', function () {
256256
$_SERVER['REQUEST_METHOD'] = 'POST';
257257

258258
$form = createForm();

tests/Forms/Container.values.mapping.phpt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ function createForm(): Form
7676
}
7777

7878

79-
test(function () { // setDefaults() + object
79+
test('setDefaults() + object', function () {
8080
$form = createForm();
8181
Assert::false($form->isSubmitted());
8282

@@ -105,7 +105,7 @@ test(function () { // setDefaults() + object
105105
});
106106

107107

108-
test(function () { // submitted form + getValues()
108+
test('submitted form + getValues()', function () {
109109
$_SERVER['REQUEST_METHOD'] = 'POST';
110110

111111
$form = createForm();
@@ -125,7 +125,7 @@ test(function () { // submitted form + getValues()
125125
});
126126

127127

128-
test(function () { // submitted form + reset()
128+
test('submitted form + reset()', function () {
129129
$_SERVER['REQUEST_METHOD'] = 'POST';
130130

131131
$form = createForm();
@@ -149,7 +149,7 @@ test(function () { // submitted form + reset()
149149
});
150150

151151

152-
test(function () { // setValues() + object
152+
test('setValues() + object', function () {
153153
$_SERVER['REQUEST_METHOD'] = 'POST';
154154

155155
$form = createForm();
@@ -197,7 +197,7 @@ test(function () { // setValues() + object
197197
});
198198

199199

200-
test(function () { // getValues(...arguments...)
200+
test('getValues(...arguments...)', function () {
201201
$_SERVER['REQUEST_METHOD'] = null;
202202

203203
$form = createForm();
@@ -249,7 +249,7 @@ test(function () { // getValues(...arguments...)
249249
});
250250

251251

252-
test(function () { // onSuccess test
252+
test('onSuccess test', function () {
253253
$_SERVER['REQUEST_METHOD'] = 'POST';
254254

255255
$form = createForm();

tests/Forms/Controls.BaseControl.phpt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use Tester\Assert;
1414
require __DIR__ . '/../bootstrap.php';
1515

1616

17-
test(function () { // error handling
17+
test('error handling', function () {
1818
$form = new Form;
1919
$input = $form->addText('text')
2020
->setRequired('error');
@@ -34,7 +34,7 @@ test(function () { // error handling
3434
});
3535

3636

37-
test(function () { // validators
37+
test('validators', function () {
3838
$form = new Form;
3939
$input = $form->addText('text');
4040
$input->setValue(123);
@@ -71,7 +71,7 @@ test(function () { // validators
7171
});
7272

7373

74-
test(function () { // validators for array
74+
test('validators for array', function () {
7575
$form = new Form;
7676
$input = $form->addMultiSelect('select', null, ['a', 'b', 'c', 'd']);
7777
$input->setValue([1, 2, 3]);
@@ -95,23 +95,23 @@ test(function () { // validators for array
9595
});
9696

9797

98-
test(function () { // setHtmlId
98+
test('setHtmlId', function () {
9999
$form = new Form;
100100
$input = $form->addText('text')->setHtmlId('myId');
101101

102102
Assert::same('<input type="text" name="text" id="myId">', (string) $input->getControl());
103103
});
104104

105105

106-
test(function () { // special name
106+
test('special name', function () {
107107
$form = new Form;
108108
$input = $form->addText('submit');
109109

110110
Assert::same('<input type="text" name="_submit" id="frm-submit">', (string) $input->getControl());
111111
});
112112

113113

114-
test(function () { // disabled
114+
test('disabled', function () {
115115
$form = new Form;
116116
$form->addText('disabled')
117117
->setDisabled()
@@ -123,7 +123,7 @@ test(function () { // disabled
123123
});
124124

125125

126-
test(function () { // disabled & submitted
126+
test('disabled & submitted', function () {
127127
$_SERVER['REQUEST_METHOD'] = 'POST';
128128
$_POST = ['disabled' => 'submitted value'];
129129

@@ -147,7 +147,7 @@ test(function () { // disabled & submitted
147147
});
148148

149149

150-
test(function () {
150+
test('', function () {
151151
$form = new Form;
152152
$form->setTranslator(new class implements Nette\Localization\ITranslator {
153153
public function translate($s, ...$parameters): string
@@ -181,7 +181,7 @@ test(function () {
181181
});
182182

183183

184-
test(function () { // change HTML name
184+
test('change HTML name', function () {
185185
$_POST = ['b' => '123', 'send' => ''];
186186
$form = new Form;
187187
$form->addSubmit('send', 'Send');

tests/Forms/Controls.Button.loadData.phpt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ before(function () {
1919
});
2020

2121

22-
test(function () {
22+
test('', function () {
2323
$_POST = [
2424
'button' => 'x',
2525
];
@@ -31,7 +31,7 @@ test(function () {
3131
});
3232

3333

34-
test(function () { // empty value
34+
test('empty value', function () {
3535
$_POST = [
3636
'button1' => '',
3737
'button2' => '0',
@@ -49,15 +49,15 @@ test(function () { // empty value
4949
});
5050

5151

52-
test(function () { // missing data
52+
test('missing data', function () {
5353
$form = new Form;
5454
$input = $form->addSubmit('button');
5555
Assert::false($input->isFilled());
5656
Assert::null($input->getValue());
5757
});
5858

5959

60-
test(function () { // malformed data
60+
test('malformed data', function () {
6161
$_POST = [
6262
'malformed' => [],
6363
];

0 commit comments

Comments
 (0)