Skip to content

Commit f8fdae8

Browse files
authored
Added dontSeeFormErrors function (#49)
1 parent 354f62a commit f8fdae8

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

src/Codeception/Module/Symfony.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1135,6 +1135,27 @@ public function seeUserPasswordDoesNotNeedRehash(UserInterface $user = null)
11351135
$this->assertFalse($encoder->needsRehash($user), 'User password needs rehash');
11361136
}
11371137

1138+
/**
1139+
* Verifies that there are no errors bound to the submitted form.
1140+
*
1141+
* ``` php
1142+
* <?php
1143+
* $I->dontSeeFormErrors();
1144+
* ```
1145+
*
1146+
* @return void
1147+
*/
1148+
public function dontSeeFormErrors()
1149+
{
1150+
$formCollector = $this->grabCollector('form', __FUNCTION__);
1151+
1152+
$this->assertEquals(
1153+
0,
1154+
$formCollector->getData()->offsetGet('nb_errors'),
1155+
'Expecting that the form does not have errors, but there were!'
1156+
);
1157+
}
1158+
11381159
public function amLoggedInAs(UserInterface $user, string $firewallName = 'main', $firewallContext = null)
11391160
{
11401161
$session = $this->grabService('session');

0 commit comments

Comments
 (0)