diff --git a/src/Codeception/Module/Symfony.php b/src/Codeception/Module/Symfony.php index b2c6af65..d7c8acec 100644 --- a/src/Codeception/Module/Symfony.php +++ b/src/Codeception/Module/Symfony.php @@ -1148,6 +1148,27 @@ public function seeUserPasswordDoesNotNeedRehash(UserInterface $user = null) $this->assertFalse($encoder->needsRehash($user), 'User password needs rehash'); } + /** + * Verifies that there are no errors bound to the submitted form. + * + * ``` php + * dontSeeFormErrors(); + * ``` + * + * @return void + */ + public function dontSeeFormErrors() + { + $formCollector = $this->grabCollector('form', __FUNCTION__); + + $this->assertEquals( + 0, + $formCollector->getData()->offsetGet('nb_errors'), + 'Expecting that the form does not have errors, but there were!' + ); + } + public function amLoggedInAs(UserInterface $user, string $firewallName = 'main', $firewallContext = null) { $session = $this->grabService('session');