38 #[BackupGlobals(false)] 39 #[BackupStaticProperties(false)] 40 #[PreserveGlobalState(false)] 52 parent::setUpBeforeClass();
57 protected function setUp(): void
62 $cookieName =
"ilias";
63 $cookieValue =
"theNewCookiesAreYummy";
64 $this->cookie = self::$cookieFactory->create($cookieName, $cookieValue);
72 $newCookie = $this->cookie->withValue(
"yes!");
73 $this->assertEquals($newValue, $newCookie->getValue());
74 $this->assertNotEquals($this->cookie->getValue(), $newCookie->getValue());
82 $newCookie = $this->cookie->withExpires($expires);
84 $this->assertEquals($expires, $newCookie->getExpires());
85 $this->assertNotEquals($this->cookie->getExpires(), $newCookie->getExpires());
92 $newCookie = $this->cookie->rememberForLongTime();
95 $this->assertNotEquals($this->cookie->getExpires(), $newCookie->getExpires());
102 $newCookie = $this->cookie->expire();
105 $this->assertNotEquals($this->cookie->getExpires(), $newCookie->getExpires());
113 $newCookie = $this->cookie->withMaxAge($maxAge);
115 $this->assertEquals($maxAge, $newCookie->getMaxAge());
116 $this->assertNotEquals($this->cookie->getMaxAge(), $newCookie->getMaxAge());
124 $newCookie = $this->cookie->withPath(
$path);
126 $this->assertEquals(
$path, $newCookie->getPath());
127 $this->assertNotEquals($this->cookie->getPath(), $newCookie->getPath());
134 $domain =
'ilias.de';
135 $newCookie = $this->cookie->withDomain($domain);
137 $this->assertEquals($domain, $newCookie->getDomain());
138 $this->assertNotEquals($this->cookie->getDomain(), $newCookie->getDomain());
146 $newCookie = $this->cookie->withSecure($secure);
148 $this->assertTrue($newCookie->getSecure());
149 $this->assertNotEquals($this->cookie->getSecure(), $newCookie->getSecure());
157 $newCookie = $this->cookie->withHttpOnly($httpOnly);
159 $this->assertTrue($newCookie->getHttpOnly());
160 $this->assertNotEquals($this->cookie->getHttpOnly(), $newCookie->getHttpOnly());
testRememberForeverDoesNotChangeTheCurrentObject()
testWithHttpOnlyDoesNotChangeTheCurrentObject()
testExpireDoesNotChangeTheCurrentObject()
testWithExpiresDoesNotChangeTheCurrentObject()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
testWithValueDoesNotChangeTheCurrentObject()
testWithSecureDoesNotChangeTheCurrentObject()
static CookieFactoryImpl $cookieFactory
testWithDomainDoesNotChangeTheCurrentObject()
testWithPathDoesNotChangeTheCurrentObject()
testWithMaxAgeDoesNotChangeTheCurrentObject()
static setUpBeforeClass()