mirror of
https://github.com/fenom-template/fenom.git
synced 2023-08-10 21:13:07 +03:00
Fix #158
This commit is contained in:
@ -77,34 +77,12 @@ class MacrosTest extends TestCase
|
||||
$this->tpl(
|
||||
"macro_recursive_import.tpl",
|
||||
'
|
||||
{import "macro_recursive.tpl" as math}
|
||||
{import [factorial] from "macro_recursive.tpl" as math}
|
||||
|
||||
{math.factorial num=10}'
|
||||
);
|
||||
}
|
||||
|
||||
public function _testSandbox()
|
||||
{
|
||||
try {
|
||||
// $this->fenom->compile("macro_recursive.tpl")->display([]);
|
||||
// $this->fenom->flush();
|
||||
// var_dump($this->fenom->fetch("macro_recursive.tpl", []));
|
||||
var_dump(
|
||||
$this->fenom->compileCode(
|
||||
'{macro factorial(num)}
|
||||
{if $num}
|
||||
{$num} {macro.factorial num=$num-1} {$num}
|
||||
{/if}
|
||||
{/macro}'
|
||||
)->getBody()
|
||||
);
|
||||
// var_dump($this->fenom->display("macro_recursive_import.tpl", array()));
|
||||
} catch (\Exception $e) {
|
||||
var_dump($e->getMessage() . ": " . $e->getTraceAsString());
|
||||
}
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws \Exception
|
||||
* @group macros
|
||||
@ -162,6 +140,7 @@ class MacrosTest extends TestCase
|
||||
$this->assertSame("10 9 8 7 6 5 4 3 2 1 1 2 3 4 5 6 7 8 9 10", Modifier::strip($tpl->fetch(array()), true));
|
||||
}
|
||||
|
||||
|
||||
public function testImportRecursive()
|
||||
{
|
||||
$this->fenom->compile('macro_recursive_import.tpl');
|
||||
|
Reference in New Issue
Block a user