Skip to content

Commit

Permalink
coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
Zordius Chen committed Mar 7, 2017
1 parent f5f307b commit 05fb0c2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/LightnCandy.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ public static function compile($template, $options = array('flags' => self::FLAG
* @param array<string,array|string|integer> $options LightnCandy compile time and run time options, default is array('flags' => LightnCandy::FLAG_BESTPERFORMANCE)
*
* @return string|false Compiled PHP code when successed. If error happened and compile failed, return false.
*
* @expect false when input '{{"}}', array('flags' => LightnCandy::FLAG_HANDLEBARS)
*/
public static function compilePartial($template, $options = array('flags' => self::FLAG_BESTPERFORMANCE)) {
$context = Context::create($options);
Expand Down
9 changes: 9 additions & 0 deletions tests/LightnCandyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@

class LightnCandyTest extends PHPUnit_Framework_TestCase
{
/**
* @covers LightnCandy\LightnCandy::compilePartial
*/
public function testOn_compilePartial() {
$method = new \ReflectionMethod('LightnCandy\LightnCandy', 'compilePartial');
$this->assertEquals(false, $method->invokeArgs(null, array_by_ref(array(
'{{"}}', array('flags' => LightnCandy::FLAG_HANDLEBARS)
))));
}
/**
* @covers LightnCandy\LightnCandy::handleError
*/
Expand Down

0 comments on commit 05fb0c2

Please sign in to comment.