I'm trying to use Panther for PhpUnit Tests in my Symfony 5 application.
When I try to log an user, like this :
$client = static::createPantherClient();
/** @var User $user */
$user = $this->getSuperAdminAccount();
$session = self::$container->get('session');
$token = new UsernamePasswordToken($user, null, 'main', $user->getRoles());
$session->set('_security_main', serialize($token));
$session->save();
$cookie = new Cookie($session->getName(), $session->getId());
$client->getCookieJar()->set($cookie);
when I run the test, I get:
Panther Facebook\WebDriver\Exception\InvalidCookieDomainException : invalid cookie domain
Can someone help me please ?