renderer = new PurePlate(__DIR__ . '/views'); } protected function tearDown(): void { } protected function execute(): void { $this->testRenderBasicView(); $this->testRenderViewWithLayout(); $this->testRenderViewWithBlock(); $this->testRenderViewWithExtendingBlock(); $this->testStartAndEndBlocks(); $this->testRenderViewNotFound(); } public function testRenderBasicView(): void { $expectedOutput = 'Hello, World!'; $output = $this->renderer->render('test.php', ['message' => 'Hello, World!']); $this->assertEquals($expectedOutput, $output); } public function testRenderViewWithLayout(): void { $expectedOutput = ''; $output = $this->renderer->render('test_layout.php'); $this->assertEquals($expectedOutput, $output); } public function testRenderViewWithBlock(): void { $expectedOutput = ''; $output = $this->renderer->render('test_block.php'); $this->assertEquals($expectedOutput, $output); } public function testRenderViewWithExtendingBlock(): void { $expectedOutput = 'Page TitlePage Content'; $output = $this->renderer->render('test_extends.php'); $this->assertEquals($expectedOutput, $output); } public function testStartAndEndBlocks(): void { $this->renderer->startBlock('content'); echo 'Block Content'; $this->renderer->endBlock(); $expectedOutput = 'Block Content'; $output = $this->renderer->block('content'); $this->assertEquals($expectedOutput, $output); } public function testRenderViewNotFound(): void { $this->expectException(\InvalidArgumentException::class, function () { $this->renderer->render('non_existent_template.php'); }); } }