/** * Test... * * @return void */ public function testRender() { JFactory::getApplication()->allowCache(true); $this->object->setBuffer('Unit Test Buffer'); $this->assertThat($this->object->render(), $this->equalTo('Unit Test Buffer'), 'We did not get the buffer back properly'); $headers = JFactory::getApplication()->getHeaders(); foreach ($headers as $head) { if ($head['name'] == 'Expires') { $this->assertThat($head['value'], $this->stringContains('GMT'), 'The expires header was not set properly (was parent::render called?)'); } if ($head['name'] == 'Content-disposition') { $this->assertThat($head['value'], $this->stringContains('.json'), 'The content disposition did not include json extension'); } } $this->assertThat(JFactory::getApplication()->allowCache(), $this->isFalse(), 'Caching was not disabled'); }
/** * @testdox Test the default return for render */ public function testTheDefaultReturnForRender() { $this->assertEmpty($this->object->render()); }