assertEquals($user, $userEmpty); $this->assertFalse($user->isLoggedIn()); $database = new Database(DATABASE_HOST, DATABASE_NAME, DATABASE_USER, DATABASE_PASSWORD); $database->connect(); $database->query( 'REPLACE INTO `users` (`email`, `password`) VALUES (:userEmail, :userPassword)', [ 'userEmail' => $userEmail, 'userPassword' => $userPassword, ] ); $userLoginSuccessful = $user->logIn($userEmail, $userPassword); $this->assertTrue($userLoginSuccessful); $this->assertEquals($userEmail, $_SESSION['user']->getEmail()); } public function testLogInNonExistingUser(): void { $user = new User(); $userEmail = 'thisemail@shouldnt.exist'; $userPassword = '1234isnotarealpassword'; $userLoginSuccessful = $user->logIn($userEmail, $userPassword); $this->assertFalse($userLoginSuccessful); } }