/** * @runInSeparateProcess **/ public function testPreview() { $app = $this->getApp(); $request = Request::create('/pages/test'); $app['request'] = $request; $templates = $this->getMock('Bolt\\TemplateChooser', array('record'), array($app)); $templates->expects($this->any())->method('record')->will($this->returnValue('record.twig')); $app['templatechooser'] = $templates; $twig = $this->getMockTwig(); $twig->expects($this->once())->method('render')->with('record.twig'); $app['twig'] = $twig; $controller = new Frontend(); $response = $controller->preview($request, $app, 'pages'); }