Class CookieWrapperTest.
More...
◆ setUp()
ILIAS\HTTP\Cookies\CookieWrapperTest::setUp |
( |
| ) |
|
|
protected |
Definition at line 58 of file CookieWrapperTest.php.
58 : void
59 {
60 parent::setUp();
61
62
63 $cookieName = "ilias";
64 $cookieValue = "theNewCookiesAreYummy";
65 $this->cookie = self::$cookieFactory->create($cookieName, $cookieValue);
66 }
◆ setUpBeforeClass()
static ILIAS\HTTP\Cookies\CookieWrapperTest::setUpBeforeClass |
( |
| ) |
|
|
static |
Definition at line 51 of file CookieWrapperTest.php.
51 : void
52 {
53 parent::setUpBeforeClass();
54 self::$cookieFactory = new CookieFactoryImpl();
55 }
◆ testExpireDoesNotChangeTheCurrentObject()
ILIAS\HTTP\Cookies\CookieWrapperTest::testExpireDoesNotChangeTheCurrentObject |
( |
| ) |
|
Definition at line 101 of file CookieWrapperTest.php.
101 : void
102 {
103 $newCookie = $this->cookie->expire();
104
105
106 $this->assertNotSame($this->cookie->getExpires(), $newCookie->getExpires());
107 }
◆ testRememberForeverDoesNotChangeTheCurrentObject()
ILIAS\HTTP\Cookies\CookieWrapperTest::testRememberForeverDoesNotChangeTheCurrentObject |
( |
| ) |
|
Definition at line 91 of file CookieWrapperTest.php.
91 : void
92 {
93 $newCookie = $this->cookie->rememberForLongTime();
94
95
96 $this->assertNotSame($this->cookie->getExpires(), $newCookie->getExpires());
97 }
◆ testWithDomainDoesNotChangeTheCurrentObject()
ILIAS\HTTP\Cookies\CookieWrapperTest::testWithDomainDoesNotChangeTheCurrentObject |
( |
| ) |
|
Definition at line 133 of file CookieWrapperTest.php.
133 : void
134 {
135 $domain = 'ilias.de';
136 $newCookie = $this->cookie->withDomain($domain);
137
138 $this->assertSame($domain, $newCookie->getDomain());
139 $this->assertNotEquals($this->cookie->getDomain(), $newCookie->getDomain());
140 }
◆ testWithExpiresDoesNotChangeTheCurrentObject()
ILIAS\HTTP\Cookies\CookieWrapperTest::testWithExpiresDoesNotChangeTheCurrentObject |
( |
| ) |
|
Definition at line 80 of file CookieWrapperTest.php.
80 : void
81 {
82 $expires = 1000;
83 $newCookie = $this->cookie->withExpires($expires);
84
85 $this->assertSame($expires, $newCookie->getExpires());
86 $this->assertNotSame($this->cookie->getExpires(), $newCookie->getExpires());
87 }
◆ testWithHttpOnlyDoesNotChangeTheCurrentObject()
ILIAS\HTTP\Cookies\CookieWrapperTest::testWithHttpOnlyDoesNotChangeTheCurrentObject |
( |
| ) |
|
Definition at line 155 of file CookieWrapperTest.php.
155 : void
156 {
157 $httpOnly = true;
158 $newCookie = $this->cookie->withHttpOnly($httpOnly);
159
160 $this->assertTrue($newCookie->getHttpOnly());
161 $this->assertNotSame($this->cookie->getHttpOnly(), $newCookie->getHttpOnly());
162 }
◆ testWithMaxAgeDoesNotChangeTheCurrentObject()
ILIAS\HTTP\Cookies\CookieWrapperTest::testWithMaxAgeDoesNotChangeTheCurrentObject |
( |
| ) |
|
Definition at line 111 of file CookieWrapperTest.php.
111 : void
112 {
113 $maxAge = 1000;
114 $newCookie = $this->cookie->withMaxAge($maxAge);
115
116 $this->assertSame($maxAge, $newCookie->getMaxAge());
117 $this->assertNotSame($this->cookie->getMaxAge(), $newCookie->getMaxAge());
118 }
◆ testWithPathDoesNotChangeTheCurrentObject()
ILIAS\HTTP\Cookies\CookieWrapperTest::testWithPathDoesNotChangeTheCurrentObject |
( |
| ) |
|
Definition at line 122 of file CookieWrapperTest.php.
122 : void
123 {
125 $newCookie = $this->cookie->withPath(
$path);
126
127 $this->assertSame(
$path, $newCookie->getPath());
128 $this->assertNotEquals($this->cookie->getPath(), $newCookie->getPath());
129 }
References $path.
◆ testWithSecureDoesNotChangeTheCurrentObject()
ILIAS\HTTP\Cookies\CookieWrapperTest::testWithSecureDoesNotChangeTheCurrentObject |
( |
| ) |
|
Definition at line 144 of file CookieWrapperTest.php.
144 : void
145 {
146 $secure = true;
147 $newCookie = $this->cookie->withSecure($secure);
148
149 $this->assertTrue($newCookie->getSecure());
150 $this->assertNotSame($this->cookie->getSecure(), $newCookie->getSecure());
151 }
◆ testWithValueDoesNotChangeTheCurrentObject()
ILIAS\HTTP\Cookies\CookieWrapperTest::testWithValueDoesNotChangeTheCurrentObject |
( |
| ) |
|
Definition at line 70 of file CookieWrapperTest.php.
70 : void
71 {
72 $newValue = "yes!";
73 $newCookie = $this->cookie->withValue("yes!");
74 $this->assertSame($newValue, $newCookie->getValue());
75 $this->assertNotEquals($this->cookie->getValue(), $newCookie->getValue());
76 }
◆ $cookie
◆ $cookieFactory
The documentation for this class was generated from the following file: