summaryrefslogtreecommitdiff
path: root/vendor/symfony/http-foundation/Tests/CookieTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/symfony/http-foundation/Tests/CookieTest.php')
-rw-r--r--vendor/symfony/http-foundation/Tests/CookieTest.php23
1 files changed, 18 insertions, 5 deletions
diff --git a/vendor/symfony/http-foundation/Tests/CookieTest.php b/vendor/symfony/http-foundation/Tests/CookieTest.php
index 61a278e656..55287e082d 100644
--- a/vendor/symfony/http-foundation/Tests/CookieTest.php
+++ b/vendor/symfony/http-foundation/Tests/CookieTest.php
@@ -24,10 +24,9 @@ use Symfony\Component\HttpFoundation\Cookie;
*/
class CookieTest extends TestCase
{
- public function invalidNames()
+ public function namesWithSpecialCharacters()
{
return [
- [''],
[',MyName'],
[';MyName'],
[' MyName'],
@@ -40,12 +39,26 @@ class CookieTest extends TestCase
}
/**
- * @dataProvider invalidNames
+ * @dataProvider namesWithSpecialCharacters
*/
- public function testInstantiationThrowsExceptionIfCookieNameContainsInvalidCharacters($name)
+ public function testInstantiationThrowsExceptionIfRawCookieNameContainsSpecialCharacters($name)
{
$this->expectException('InvalidArgumentException');
- Cookie::create($name);
+ Cookie::create($name, null, 0, null, null, null, false, true);
+ }
+
+ /**
+ * @dataProvider namesWithSpecialCharacters
+ */
+ public function testInstantiationSucceedNonRawCookieNameContainsSpecialCharacters($name)
+ {
+ $this->assertInstanceOf(Cookie::class, Cookie::create($name));
+ }
+
+ public function testInstantiationThrowsExceptionIfCookieNameIsEmpty()
+ {
+ $this->expectException('InvalidArgumentException');
+ Cookie::create('');
}
public function testInvalidExpiration()