/** * @covers \Bluz\Response\AbstractResponse::addHeader * @covers \Bluz\Response\AbstractResponse::getHeader * @covers \Bluz\Response\AbstractResponse::getHeaderAsArray */ public function testAddHeader() { $this->response->addHeader('foo', 'bar'); $this->response->addHeader('foo', 'baz'); $this->assertTrue($this->response->hasHeader('foo')); $this->assertEquals('bar, baz', $this->response->getHeader('foo')); $this->assertEqualsArray(['bar', 'baz'], $this->response->getHeaderAsArray('foo')); $this->assertEqualsArray([], $this->response->getHeaderAsArray('baz')); }
/** * Test Expires */ public function testLastModifiedAsDate() { $date = new \DateTime('2012-12-12T12:12:12+00:00'); $this->cacheControl->setLastModified($date); $this->assertEquals('Wed, 12 Dec 2012 12:12:12 GMT', $this->cacheControl->getLastModified()); $this->assertEquals('Wed, 12 Dec 2012 12:12:12 GMT', $this->response->getHeader('Last-Modified')); }