mirror of
https://github.com/Mibew/handlebars.php.git
synced 2025-05-03 10:33:08 +03:00
add test for InlineLoader
This commit is contained in:
parent
4bf343d122
commit
317e1ebd6c
@ -619,6 +619,23 @@ class HandlebarsTest extends \PHPUnit_Framework_TestCase
|
|||||||
$this->assertEquals('test', $engine->render('loader', array()));
|
$this->assertEquals('test', $engine->render('loader', array()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test inline loader
|
||||||
|
*/
|
||||||
|
public function testInlineLoader()
|
||||||
|
{
|
||||||
|
$loader = new \Handlebars\Loader\InlineLoader(__FILE__, __COMPILER_HALT_OFFSET__);
|
||||||
|
$this->assertEquals('This is a inline template.', $loader->load('template1'));
|
||||||
|
|
||||||
|
$expected = <<<EOM
|
||||||
|
a
|
||||||
|
b
|
||||||
|
c
|
||||||
|
d
|
||||||
|
EOM;
|
||||||
|
$this->assertEquals($expected, $loader->load('template2'));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test file system loader
|
* Test file system loader
|
||||||
*/
|
*/
|
||||||
@ -1156,3 +1173,17 @@ class HandlebarsTest extends \PHPUnit_Framework_TestCase
|
|||||||
$this->assertEquals($argsString, (string)$args);
|
$this->assertEquals($argsString, (string)$args);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Testcase for testInlineLoader
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
__halt_compiler();
|
||||||
|
@@ template1
|
||||||
|
This is a inline template.
|
||||||
|
|
||||||
|
@@ template2
|
||||||
|
a
|
||||||
|
b
|
||||||
|
c
|
||||||
|
d
|
Loading…
Reference in New Issue
Block a user