summaryrefslogtreecommitdiff
path: root/vendor/symfony/http-foundation/Tests/HeaderBagTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/symfony/http-foundation/Tests/HeaderBagTest.php')
-rw-r--r--vendor/symfony/http-foundation/Tests/HeaderBagTest.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/vendor/symfony/http-foundation/Tests/HeaderBagTest.php b/vendor/symfony/http-foundation/Tests/HeaderBagTest.php
index a5876f9e3a..dcc266f69c 100644
--- a/vendor/symfony/http-foundation/Tests/HeaderBagTest.php
+++ b/vendor/symfony/http-foundation/Tests/HeaderBagTest.php
@@ -48,6 +48,13 @@ class HeaderBagTest extends TestCase
$this->assertInstanceOf('DateTime', $headerDate);
}
+ public function testGetDateNull()
+ {
+ $bag = new HeaderBag(['foo' => null]);
+ $headerDate = $bag->getDate('foo');
+ $this->assertNull($headerDate);
+ }
+
public function testGetDateException()
{
$this->expectException('RuntimeException');
@@ -96,6 +103,9 @@ class HeaderBagTest extends TestCase
$bag->set('foo', 'bor', false);
$this->assertEquals('bar', $bag->get('foo'), '->get return first value');
$this->assertEquals(['bar', 'bor'], $bag->get('foo', 'nope', false), '->get return all values as array');
+
+ $bag->set('baz', null);
+ $this->assertNull($bag->get('baz', 'nope'), '->get return null although different default value is given');
}
public function testSetAssociativeArray()