tempDir = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'eyrie_tests_' . uniqid(); mkdir($this->tempDir); $this->cacheDir = $this->tempDir . DIRECTORY_SEPARATOR . 'cache'; } protected function tearDown(): void { $this->removeDirectory($this->tempDir); } public function testRenderSimpleText(): void { file_put_contents($this->tempDir . '/hello.eyrie.php', 'Hello World'); $loader = new FileLoader([$this->tempDir]); $engine = new Engine($loader, ['cache' => $this->cacheDir]); $this->assertEquals('Hello World', $engine->render('hello')); } public function testRenderVariable(): void { file_put_contents($this->tempDir . '/greet.eyrie.php', 'Hello << name >>!'); $loader = new FileLoader([$this->tempDir]); $engine = new Engine($loader, ['cache' => $this->cacheDir]); $this->assertEquals('Hello Junie!', $engine->render('greet', ['name' => 'Junie'])); } public function testAutoEscaping(): void { file_put_contents($this->tempDir . '/escape.eyrie.php', '<< content >>'); $loader = new FileLoader([$this->tempDir]); $engine = new Engine($loader, ['cache' => $this->cacheDir]); $this->assertEquals('<script>', $engine->render('escape', ['content' => '