Skip to content

Commit

Permalink
AD-231 Configure example instance to get a valid domain
Browse files Browse the repository at this point in the history
  • Loading branch information
Dani Esteban committed May 27, 2022
1 parent 33d43f2 commit d4918ef
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 13 deletions.
7 changes: 1 addition & 6 deletions src/Sifo/Cookie.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ static private function _initDomain()
{
self::$cookies = array( );
// Take domain from configuration to allow multiple subdomain compatibility with cookies.
self::$domain = static::domain();
self::$domain = Domains::getInstance()->getDomain();
self::$path = '/';
}

Expand Down Expand Up @@ -152,9 +152,4 @@ static protected function setCookie(string $name, $value = "", $expires = 0, $pa

return setcookie( $name, $value, $options );
}

static protected function domain()
{
return Domains::getInstance()->getDomain();
}
}
4 changes: 2 additions & 2 deletions test/Sifo/CookieTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function testCookieIsSetWithExpectedDefaults(): void
"Expires doesn't match with expected."
);
$this->assertSame(
'example',
'sifo.local',
TestCookie::getDomain($cookieName),
"Domain doesn't match with expected."
);
Expand Down Expand Up @@ -62,7 +62,7 @@ public function testCookieIsSetWithCustomParameters(): void
"Expires doesn't match with expected."
);
$this->assertSame(
'example',
'sifo.local',
TestCookie::getDomain($cookieName),
"Domain doesn't match with expected."
);
Expand Down
5 changes: 0 additions & 5 deletions test/Sifo/TestCookie.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,4 @@ public static function clearCookies(): void
{
self::$cookies = [];
}

protected static function domain()
{
return 'example';
}
}

0 comments on commit d4918ef

Please sign in to comment.