Skip to content

Commit 60855f1

Browse files
Dani Estebankpicaza
authored andcommitted
AD-231 Configure example instance to get a valid domain
1 parent bfdc5eb commit 60855f1

File tree

3 files changed

+3
-13
lines changed

3 files changed

+3
-13
lines changed

src/Sifo/Cookie.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ static private function _initDomain()
4949
{
5050
self::$cookies = array( );
5151
// Take domain from configuration to allow multiple subdomain compatibility with cookies.
52-
self::$domain = static::domain();
52+
self::$domain = Domains::getInstance()->getDomain();
5353
self::$path = '/';
5454
}
5555

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

153153
return setcookie( $name, $value, $options );
154154
}
155-
156-
static protected function domain()
157-
{
158-
return Domains::getInstance()->getDomain();
159-
}
160155
}

test/Sifo/CookieTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public function testCookieIsSetWithExpectedDefaults(): void
2525
"Expires doesn't match with expected."
2626
);
2727
$this->assertSame(
28-
'example',
28+
'sifo.local',
2929
TestCookie::getDomain($cookieName),
3030
"Domain doesn't match with expected."
3131
);
@@ -62,7 +62,7 @@ public function testCookieIsSetWithCustomParameters(): void
6262
"Expires doesn't match with expected."
6363
);
6464
$this->assertSame(
65-
'example',
65+
'sifo.local',
6666
TestCookie::getDomain($cookieName),
6767
"Domain doesn't match with expected."
6868
);

test/Sifo/TestCookie.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,4 @@ public static function clearCookies(): void
8989
{
9090
self::$cookies = [];
9191
}
92-
93-
protected static function domain()
94-
{
95-
return 'example';
96-
}
9792
}

0 commit comments

Comments
 (0)