public function testSpawnView() { $module = $this->getMockBuilder('Nethgui\\Controller\\AbstractController')->setConstructorArgs(array('InnerModule'))->setMethods(array())->getMock(); $module->expects($this->once())->method('getIdentifier')->will($this->returnValue('InnerModule')); $innerView1 = $this->object->spawnView($module, TRUE); $innerView2 = $this->object->spawnView($module, 'View2'); $this->assertInstanceOf('Nethgui\\View\\ViewInterface', $innerView1); $this->assertInstanceOf('Nethgui\\View\\ViewInterface', $innerView2); $this->assertEquals($innerView1, $this->object['InnerModule']); $this->assertEquals($innerView2, $this->object['View2']); }
/** * @param integer $code * @param string $location */ private function httpRedirection($code, $location) { // Prefix the site URL to $location: if (!in_array(parse_url($location, PHP_URL_SCHEME), array('http', 'https'))) { $url = $this->view->getSiteUrl() . $location; } $this->response->setStatus(302)->addHeader('Location: ' . $url); return $this; }