diff --git a/app/src/Controller/User/RegisterUserAction.php b/app/src/Controller/User/RegisterUserAction.php index 7e7c006..c5a445f 100644 --- a/app/src/Controller/User/RegisterUserAction.php +++ b/app/src/Controller/User/RegisterUserAction.php @@ -21,7 +21,8 @@ class RegisterUserAction extends Controller $requestData = $this->request->getParsedBody(); if ($requestData['password'] !== $requestData['checked_password']) { - $this->session->getFlash()->add('error', "Passwords do not match."); + $this->session->getFlash() + ->add('error', "Passwords do not match."); $response = $this->render('user/register.twig'); return $response->withStatus(400); } diff --git a/app/tests/Controller/User/RegisterUserActionTest.php b/app/tests/Controller/User/RegisterUserActionTest.php index 539ba1c..31dfc33 100644 --- a/app/tests/Controller/User/RegisterUserActionTest.php +++ b/app/tests/Controller/User/RegisterUserActionTest.php @@ -54,7 +54,6 @@ class RegisterUserActionTest extends TestCase public function testFailingRegistration(): void { $user = $this->getUser(); - $app = $this->getAppInstance(); /** @var $container \DI\Container */ @@ -75,7 +74,7 @@ class RegisterUserActionTest extends TestCase $flash = $container->get(SessionInterface::class)->getFlash(); $errorMessages = $flash->get('error'); $this->assertIsArray($errorMessages); - $this->assertNotNull($errorMessages); - $this->assertEquals('Unable to register user.', $errorMessage[0]); + $this->assertNotEmpty($errorMessages); + $this->assertEquals('Unable to register user.', $errorMessages[0]); } }