feature/current-namespaces #1

Merged
aldarien merged 4 commits from feature/current-namespaces into master 2025-09-29 12:40:51 -03:00
6 changed files with 39 additions and 13 deletions
Showing only changes of commit 3ce904c7af - Show all commits

28
tests/ViewTest.php Normal file
View File

@ -0,0 +1,28 @@
<?php
use PHPUnit\Framework\TestCase;
class ViewTest extends TestCase
{
public function testRender(): void
{
$response = $this->getMockBuilder(Psr\Http\Message\ResponseInterface::class)
->disableOriginalConstructor()
->getMock();
$templatesFolder = './templates';
mkdir($templatesFolder);
$cacheFolder = './cache';
mkdir($cacheFolder);
chmod($cacheFolder, 0o777);
$templateName = 'test';
$template = <<<TEMPLATE
Test Template
TEMPLATE;
file_put_contents("{$templatesFolder}/{$templateName}.blade.php", $template);
$view = new View\Implement\View($templatesFolder, $cacheFolder);
$result = $view->render($response, $templateName);
$this->assertEquals($template, $result->getBody()->getContenst());
}
}