From 8ac1982802050b37204a79202016cf11e23a886a Mon Sep 17 00:00:00 2001 From: Tavo Nieves J Date: Fri, 20 Nov 2020 11:07:20 -0500 Subject: [PATCH] Added dontSeeFormErrors function --- src/Codeception/Module/Symfony.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) 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');