mirror of
https://github.com/fenom-template/fenom.git
synced 2023-08-10 21:13:07 +03:00
Fix tests
Add docs
This commit is contained in:
@@ -11,8 +11,11 @@ class TemplateTest extends \PHPUnit_Framework_TestCase {
|
||||
public static $aspect;
|
||||
|
||||
public function setUp() {
|
||||
exec("rm -f ".ASPECT_RESOURCES.'/compile/*');
|
||||
mkdir(ASPECT_RESOURCES.'/compile', 0777, true);
|
||||
if(!file_exists(ASPECT_RESOURCES.'/compile')) {
|
||||
mkdir(ASPECT_RESOURCES.'/compile', 0777, true);
|
||||
} else {
|
||||
exec("rm -f ".ASPECT_RESOURCES.'/compile/*');
|
||||
}
|
||||
self::$aspect = Aspect::factory(ASPECT_RESOURCES.'/template', ASPECT_RESOURCES.'/compile');
|
||||
self::$aspect->addTemplate(new Render("welcome.tpl", function ($tpl) {
|
||||
echo "<b>Welcome, ".$tpl["username"]." (".$tpl["email"].")</b>";
|
||||
|
@@ -15,7 +15,9 @@ class AspectTest extends \PHPUnit_Framework_TestCase {
|
||||
}
|
||||
|
||||
public function setUp() {
|
||||
mkdir(ASPECT_RESOURCES.'/compile', 0777, true);
|
||||
if(!file_exists(ASPECT_RESOURCES.'/compile')) {
|
||||
mkdir(ASPECT_RESOURCES.'/compile', 0777, true);
|
||||
}
|
||||
self::tearDownAfterClass();
|
||||
$this->aspect = $aspect = Aspect::factory(ASPECT_RESOURCES.'/template', ASPECT_RESOURCES.'/compile');
|
||||
$aspect->setCompileDir(ASPECT_RESOURCES.'/compile');
|
||||
|
Reference in New Issue
Block a user