/** * Test... * * @return void */ public function testGetMimeEncoding() { $this->object->setMimeEncoding('image'); $this->assertEquals('image', $this->object->getMimeEncoding(), 'getMimeEncoding should be image'); $this->object->setMimeEncoding('zip'); $this->assertEquals('zip', $this->object->getMimeEncoding(), 'getMimeEncoding should be zip'); }
/** * @todo Implement testRender(). */ public function testRender() { $this->object = new JDocument(); $this->object->render(); $headers = JResponse::getHeaders(); $lastMod = false; $contentType = false; foreach ($headers as $header) { if ($header['name'] == 'Last-Modified') { $lastMod = $header; } if ($header['name'] == 'Content-Type') { $contentType = $header; } } $this->assertThat($lastMod, $this->equalTo(false)); $this->assertThat($contentType['value'], $this->equalTo('; charset=utf-8')); $this->object->setModifiedDate('My date'); $this->object->setMimeEncoding('MyMimeType'); $this->object->setCharset('MyCharset'); $this->object->render(); $headers = JResponse::getHeaders(); $lastMod = false; $contentType = false; foreach ($headers as $header) { if ($header['name'] == 'Last-Modified') { $lastMod = $header; } if ($header['name'] == 'Content-Type') { $contentType = $header; } } $this->assertThat($lastMod['value'], $this->equalTo('My date')); $this->assertThat($contentType['value'], $this->equalTo('mymimetype; charset=MyCharset')); }
/** * @testdox Test that setMimeEncoding returns an instance of $this */ public function testEnsureSetMimeEncodingReturnsThisObject() { $this->assertSame($this->object, $this->object->setMimeEncoding('application/json')); }