Handle broken pipes

This commit is contained in:
Justin Hileman
2012-10-01 14:51:15 -07:00
parent d209d1aea9
commit a64a6f82ee
2 changed files with 26 additions and 2 deletions
@@ -50,4 +50,26 @@ class Mustache_Test_FiveThree_Functional_FiltersTest extends PHPUnit_Framework_T
$this->assertEquals('[[2000-01-01 12:01:00]]', $tpl->render($foo));
}
public function testBrokenPipe() {
$tpl = $this->mustache->loadTemplate('{{% FILTERS }}{{ foo | bar | baz }}');
$this->assertEquals('', $tpl->render(array(
'foo' => 'FOO',
)));
$this->assertEquals('', $tpl->render(array(
'foo' => 'FOO',
'bar' => function($value) { return 'BAR'; },
)));
$this->assertEquals('', $tpl->render(array(
'foo' => 'FOO',
'baz' => function($value) { return 'BAZ'; },
)));
$this->assertEquals('', $tpl->render(array(
'bar' => function($value) { return 'BAR'; },
'baz' => function($value) { return 'BAZ'; },
)));
}
}