public function testNamespaceNotFound() { $view = new View(__DIR__ . "/templates/cache", TRUE); try { $view->registerNamespace('App1', __DIR__ . '/templates'); $twig = $view->getTwig('App\\Index'); } catch (Exception $e) { $this->assertEquals("Namespace not found", $e->getMessage()); $this->assertEquals(404, $e->getCode()); } }
/** @GET */ public function html(View $view) { return $view->getTwig(__CLASS__)->render('index.twig', $this->json()); }