Skip to content

Commit

Permalink
Minor improvements to session cookie test
Browse files Browse the repository at this point in the history
  • Loading branch information
devdot committed Jul 30, 2024
1 parent 6a4baa8 commit 420bb75
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions tests/Integration/Requests/AuthRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,14 @@ public function testAuthWithSessionCookie(): void
$this->assertNotNull($cookie);

// clear config
CTConfig::clearConfig();
CTConfig::setApiUrl(IntegrationTestData::get()->getApiUrl());
CTConfig::clearCookies();

// verify that we are not logged in now
$this->assertNull(CTConfig::getSessionCookieString());
CTConfig::setApiUrl(IntegrationTestData::get()->getApiUrl());
$this->assertFalse(CTConfig::validateAuthentication());

// clear again
CTConfig::clearCookies();

// login using the cookie
$auth = CTConfig::authWithSessionCookie($cookie);
Expand All @@ -55,6 +58,7 @@ public function testAuthWithSessionCookie(): void

// confirm the session cookie was updated (but not replaced)
$updatedCookie = CTConfig::getSessionCookieString();
$this->assertNotNull($updatedCookie);
$this->assertSame(explode(';', $cookie, 2)[0], explode(';', $updatedCookie, 2)[0]);
}

Expand Down

0 comments on commit 420bb75

Please sign in to comment.