tpl = new TemplateResponse('app', 'home'); } public function testSetParamsConstructor(): void { $params = ['hi' => 'yo']; $this->tpl = new TemplateResponse('app', 'home', $params); $this->assertEquals(['hi' => 'yo'], $this->tpl->getParams()); } public function testSetRenderAsConstructor(): void { $renderAs = 'myrender'; $this->tpl = new TemplateResponse('app', 'home', [], $renderAs); $this->assertEquals($renderAs, $this->tpl->getRenderAs()); } public function testSetParams(): void { $params = ['hi' => 'yo']; $this->tpl->setParams($params); $this->assertEquals(['hi' => 'yo'], $this->tpl->getParams()); } public function testGetTemplateName(): void { $this->assertEquals('home', $this->tpl->getTemplateName()); } public function testGetRenderAs(): void { $render = 'myrender'; $this->tpl->renderAs($render); $this->assertEquals($render, $this->tpl->getRenderAs()); } public function testChainability(): void { $params = ['hi' => 'yo']; $this->tpl->setParams($params) ->setStatus(Http::STATUS_NOT_FOUND); $this->assertEquals(Http::STATUS_NOT_FOUND, $this->tpl->getStatus()); $this->assertEquals(['hi' => 'yo'], $this->tpl->getParams()); } }