Skip to content

Commit f7b7669

Browse files
committed
tests: used Assert::count
1 parent c7edbce commit f7b7669

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
},
2222
"require-dev": {
2323
"nette/di": "~2.3",
24-
"nette/tester": "~1.0",
24+
"nette/tester": "~1.3",
2525
"latte/latte": "~2.2, >=2.2.3",
2626
"tracy/tracy": "~2.2"
2727
},

tests/Forms/Forms.maxPostSize.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ $form->addHidden('x');
1919
$form->isSuccess();
2020

2121
$errors = $form->getErrors();
22-
Assert::same( 1, count($errors) );
22+
Assert::count( 1, $errors );
2323
Assert::match( 'The size of the uploaded file can be up to %d% bytes.', $errors[0] );

tests/Forms/Rules.required.phpt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ test(function() { // Rules
3232
Assert::true( $rules->isRequired() );
3333

3434
$items = iterator_to_array($rules);
35-
Assert::same( 1, count($items) );
35+
Assert::count( 1, $items );
3636
Assert::same( Form::REQUIRED, $items[0]->validator );
3737
Assert::null( $items[0]->branch );
3838
Assert::false( $items[0]->isNegative );
@@ -51,13 +51,13 @@ test(function() { // 'required' is always the first rule
5151
$rules->addRule($form::REQUIRED);
5252

5353
$items = iterator_to_array($rules);
54-
Assert::same( 2, count($items) );
54+
Assert::count( 2, $items );
5555
Assert::same( Form::REQUIRED, $items[0]->validator );
5656
Assert::same( Form::EMAIL, $items[1]->validator );
5757

5858
$rules->addRule(~$form::REQUIRED);
5959
$items = iterator_to_array($rules);
60-
Assert::same( 2, count($items) );
60+
Assert::count( 2, $items );
6161
Assert::same( Form::REQUIRED, $items[0]->validator );
6262
Assert::true( $items[0]->isNegative );
6363
Assert::same( Form::EMAIL, $items[1]->validator );
@@ -77,7 +77,7 @@ test(function() { // setRequired(FALSE)
7777
$rules->setRequired(FALSE);
7878

7979
$items = iterator_to_array($rules);
80-
Assert::same( 1, count($items) );
80+
Assert::count( 1, $items );
8181
Assert::same( Form::EMAIL, $items[0]->validator );
8282

8383
Assert::false( $rules->validate() );

0 commit comments

Comments
 (0)