mirror of
https://github.com/fenom-template/fenom.git
synced 2023-08-10 21:13:07 +03:00
Fix tests
This commit is contained in:
parent
2fc84c226e
commit
7c038e0ba9
@ -69,7 +69,7 @@ class Compiler
|
||||
}
|
||||
$inc = $tpl->getStorage()->compile($name, false);
|
||||
$tpl->addDepend($inc);
|
||||
return '?>' . $tpl->getBody() . '<?php';
|
||||
return '?>' . $inc->getBody() . '<?php';
|
||||
}
|
||||
|
||||
|
||||
|
@ -103,6 +103,7 @@ class TestCase extends \PHPUnit_Framework_TestCase
|
||||
mkdir(FENOM_RESOURCES . '/template/' . $dir, 0777, true);
|
||||
}
|
||||
file_put_contents(FENOM_RESOURCES . '/template/' . $name, $code);
|
||||
return filemtime(FENOM_RESOURCES . '/template/' . $name);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -163,9 +164,10 @@ class TestCase extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
$template = $this->fenom->compileCode($tpl);
|
||||
if ($debug) {
|
||||
print_r("$tpl:\n" . $template->getBody());
|
||||
print_r("\nDEBUG $tpl:\n" . $template->getBody());
|
||||
}
|
||||
$this->assertSame($result, $template->fetch($this->values));
|
||||
return $template;
|
||||
}
|
||||
|
||||
|
||||
|
@ -266,7 +266,7 @@ class TemplateTest extends TestCase
|
||||
"username" => "Master",
|
||||
"email" => "dev@null.net"
|
||||
);
|
||||
$result = 'Include <b>Welcome, Master (dev@null.net)</b> template';
|
||||
$result = 'Include <b>Welcome, Master (dev@null.net)</b> template';
|
||||
return array(
|
||||
array('Include {insert "welcome.tpl"} template', $a, $result),
|
||||
array("Include {insert 'welcome.tpl'} template", $a, $result),
|
||||
@ -839,10 +839,8 @@ class TemplateTest extends TestCase
|
||||
*/
|
||||
public function testInsert($code, $vars, $result)
|
||||
{
|
||||
$this->tpl('insert.tpl', $code);
|
||||
$this->assertRender('insert.tpl', $result, $vars);
|
||||
$tpl = $this->exec($code, $vars, $result);
|
||||
$this->assertTrue($tpl->isValid());
|
||||
$this->values = $vars;
|
||||
$tpl = $this->assertRender($code, $result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user