Fix tests

This commit is contained in:
bzick 2013-09-14 19:55:53 +04:00
parent 2fc84c226e
commit 7c038e0ba9
3 changed files with 7 additions and 7 deletions

View File

@ -69,7 +69,7 @@ class Compiler
}
$inc = $tpl->getStorage()->compile($name, false);
$tpl->addDepend($inc);
return '?>' . $tpl->getBody() . '<?php';
return '?>' . $inc->getBody() . '<?php';
}

View File

@ -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;
}

View File

@ -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);
}
/**