Skip to content

Commit ddb9eed

Browse files
committed
move invalidate session statement
1 parent 9a1dff8 commit ddb9eed

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/_support/Helper/Browser/PhpBrowser.php

+4-5
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,6 @@ public function seeInSubmittedEmailChildrenBody(string $string, Email $email)
366366

367367
$this->assertGreaterThan(0, count($message->getChildren()));
368368

369-
/** @var \Swift_Mime_SimpleMimeEntity $child */
370369
foreach ($message->getChildren() as $child) {
371370
$this->assertContains($string, is_null($child->getBody()) ? '' : $child->getBody());
372371
}
@@ -385,7 +384,6 @@ public function dontSeeInSubmittedEmailChildrenBody(string $string, Email $email
385384

386385
/** @var Mail $message */
387386
foreach ($collectedMessages as $message) {
388-
/** @var \Swift_Mime_SimpleMimeEntity $child */
389387
foreach ($message->getChildren() as $child) {
390388
$this->assertNotContains($string, is_null($child->getBody()) ? '' : $child->getBody());
391389
}
@@ -418,7 +416,6 @@ public function amLoggedInAsFrontendUser(UserInterface $user, string $firewallNa
418416

419417
$this->pimcoreCore->client->getCookieJar()->clear();
420418
$this->pimcoreCore->client->getCookieJar()->set($cookie);
421-
422419
}
423420

424421
/**
@@ -443,16 +440,18 @@ public function amLoggedInAs($username)
443440
return;
444441
}
445442

446-
\Pimcore\Tool\Session::invalidate();
447443
\Pimcore\Tool\Session::useSession(function (AttributeBagInterface $adminSession) use ($pimcoreUser) {
444+
445+
\Pimcore\Tool\Session::invalidate();
446+
448447
$adminSession->set('user', $pimcoreUser);
448+
$adminSession->set('csrfToken', self::PIMCORE_ADMIN_CSRF_TOKEN_NAME);
449449
});
450450

451451
$cookie = new Cookie(\Pimcore\Tool\Session::getSessionName(), \Pimcore\Tool\Session::getSessionId());
452452

453453
$this->pimcoreCore->client->getCookieJar()->clear();
454454
$this->pimcoreCore->client->getCookieJar()->set($cookie);
455-
456455
}
457456

458457
/**

0 commit comments

Comments
 (0)