' . json_encode($body, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT) . ''; + } + + private function getResourceInfo(ResourceObject $ro): string + { + $info = ''; + $info .= $this->getInterceptorInfo($ro); + $info .= $this->getProfileInfo($ro); + + return $info; + } + + private function getInterceptorInfo(ResourceObject $ro): string + { + $result = self::BADGE_INTERCEPTORS . self::DIV_WELL; + if (! isset($ro->headers[DevInvoker::HEADER_INTERCEPTORS])) { + return $result . 'n/a
{{h $this->greeting }}
diff --git a/tests/Fake/app/var/qiq/template/Page/Halo.php b/tests/Fake/app/var/qiq/template/Page/Halo.php new file mode 100644 index 0000000..75201eb --- /dev/null +++ b/tests/Fake/app/var/qiq/template/Page/Halo.php @@ -0,0 +1,12 @@ +setLayout('layout/base'); +?> +{{h $this->greeting }}
+ +{{= $this->ja }} + diff --git a/tests/Fake/app/var/log/.gitkeep b/tests/Fake/app/var/qiq/template/Page/Index.php old mode 100755 new mode 100644 similarity index 100% rename from tests/Fake/app/var/log/.gitkeep rename to tests/Fake/app/var/qiq/template/Page/Index.php diff --git a/tests/Fake/app/var/qiq/template/layout/base.php b/tests/Fake/app/var/qiq/template/layout/base.php new file mode 100644 index 0000000..2db95a7 --- /dev/null +++ b/tests/Fake/app/var/qiq/template/layout/base.php @@ -0,0 +1,8 @@ + + +{{ greeting }}
+Hello World!
+'; + } + }; + $renderer = new HaloRenderer($originalRenderer, new TemplateLocator(new Meta('MyVendor\MyProject'))); + $ro = (new Injector(new class extends AbstractModule{ + protected function configure(): void + { + $this->bindInterceptor( + $this->matcher->any(), + $this->matcher->any(), + [NullInterceptor::class] + ); + $this->bind(FakeHalo::class); + $this->bind(RenderInterface::class)->to(NullRenderer::class); + } + }))->getInstance(FakeHalo::class); + $ro->uri = 'page://self/dummy'; + $view = $renderer->render($ro); + $this->assertStringStartsWith('', $view); + $this->assertStringContainsString('