Skip to content

Commit

Permalink
tests: compatibility with Latte master
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed May 18, 2016
1 parent 9a288ab commit 54c618b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Bridges/CacheLatte/CacheMacro.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ public function finalize()
public function nodeOpened(Latte\MacroNode $node)
{
if ($node->modifiers) {
throw new Latte\CompileException("Modifiers are not allowed in {{$node->name}}");
throw new Latte\CompileException('Modifiers are not allowed in ' . Latte\Helpers::formatNotation($node));
}
$this->used = TRUE;
$node->isEmpty = FALSE;
$node->empty = FALSE;
$node->openingCode = Latte\PhpWriter::using($node)
->write('<?php if (Nette\Bridges\CacheLatte\CacheMacro::createCache($this->global->cacheStorage, %var, $this->global->cacheStack, %node.array?)) { ?>',
Nette\Utils\Random::generate()
Expand Down
7 changes: 5 additions & 2 deletions tests/Bridges.Latte/expected/CacheMacro.cache.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,14 @@ Noncached content

%A%
if (Nette\Bridges\CacheLatte\CacheMacro::createCache($this->global->cacheStorage, '%[\w]+%', $this->global->cacheStack, [$id, 'tags' => 'mytag'])) {
?>
?>

<h1><?php echo %a% ?></h1>

<?php $this->createTemplate('include.cache.latte', ['localvar' => 11] + $this->params, "include")->renderToContentType('html') ?>
<?php
/* line 7 */
$this->createTemplate('include.cache.latte', ['localvar' => 11] + $this->params, "include")->renderToContentType('html');
?>

<?php
$_tmp = array_pop($this->global->cacheStack);
Expand Down

0 comments on commit 54c618b

Please sign in to comment.