Skip to content

Commit

Permalink
test bug #12198
Browse files Browse the repository at this point in the history
  • Loading branch information
cweiske committed Mar 3, 2008
1 parent a85205d commit 2b402e6
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
3 changes: 2 additions & 1 deletion HTML/Template/PHPLIB/Generator.php
Expand Up @@ -112,7 +112,8 @@ function getBlocks($arLines)
$arBlocks = array();
$arRefs = array();
$strRegex = '/<!--\s+(BEGIN|END)\s+([a-zA-Z0-9_]*)\s+-->/';
foreach ($arLines as $nLine => $strLine) {
foreach ($arLines as $strLine) {
$arMatches = array();
if (!preg_match($strRegex, $strLine, $arMatches)) {
continue;
}
Expand Down
21 changes: 21 additions & 0 deletions tests/HTML_Template_PHPLIBTest.php
Expand Up @@ -175,6 +175,27 @@ public function testSetFile() {
$this->assertEquals('templates/simple2.tpl', $this->tpl->file['testfile2']);
}



/**
* This should show a bug, but it does not (#12198)
*/
public function testSetFileMultipleTimes()
{
$this->assertTrue(
$this->tpl->setFile('testfile', 'block.tpl')
);
$this->assertTrue(
$this->tpl->setFile('testfile2', 'block.tpl')
);
$this->assertTrue(
$this->tpl->setBlock('testfile', 'hello_world', 'hello_world_ref')
);
$this->tpl->parse('hello_world_ref', 'hello_world');
}//public function testSetFileMultipleTimes()



/**
*
*/
Expand Down

0 comments on commit 2b402e6

Please sign in to comment.