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 Jun 14, 2016
1 parent af79d39 commit 90cdc20
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 33 deletions.
2 changes: 1 addition & 1 deletion src/Bridges/FormsLatte/FormMacros.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function macroForm(MacroNode $node, PhpWriter $writer)
if ($name === FALSE) {
throw new CompileException('Missing form name in ' . $node->getNotation());
}
$node->replaced = true;
$node->replaced = TRUE;
$node->tokenizer->reset();
return $writer->write(
"/* line $node->startLine */\n"
Expand Down
10 changes: 1 addition & 9 deletions tests/Forms.Latte/expected/FormMacros.button.phtml
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
<?php
// source: %A%

class Template%a% extends Latte\Runtime\Template
{

function render()
{
%A%
$form = $_form = $this->global->formsStack[] = $this->global->uiControl["myForm"];
?><form<?php
Expand All @@ -29,5 +22,4 @@ class Template%a% extends Latte\Runtime\Template
?></form>
<?php
}

}
%A%
10 changes: 1 addition & 9 deletions tests/Forms.Latte/expected/FormMacros.formContainer.phtml
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
<?php
// source: %A%

class Template%a% extends Latte\Runtime\Template
{

function render()
{
%A%
echo Nette\Bridges\FormsLatte\Runtime::renderFormBegin($form = $_form = $this->global->formsStack[] = $this->global->uiControl["myForm"], []);
?>
Expand Down Expand Up @@ -89,5 +82,4 @@ class Template%a% extends Latte\Runtime\Template

<?php
}

}
%A%
20 changes: 6 additions & 14 deletions tests/Forms.Latte/expected/FormMacros.forms.phtml
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
<?php
// source: %A%

class Template%a% extends Latte\Runtime\Template
{

function render()
{
%A%
/* line 1 */
echo Nette\Bridges\FormsLatte\Runtime::renderFormBegin($form = $_form = $this->global->formsStack[] = $this->global->uiControl["myForm"], ['id' => 'myForm', 'class'=>"ajax"]);
Expand All @@ -23,12 +16,12 @@ class Template%a% extends Latte\Runtime\Template
echo $_input->getControl()->addAttributes(['title' => 'Hello', 'size' => 10]) /* line 4 */ ?>

<?php
echo LR\Filters::escapeHtml($_input->getError());
echo LR\Filters::escapeHtmlText($_input->getError());
?>

<?php
$_input = is_object($name) ? $name : end($this->global->formsStack)[$name];
echo LR\Filters::escapeHtml($_input->getError());
echo LR\Filters::escapeHtmlText($_input->getError());
?>


Expand All @@ -43,7 +36,7 @@ class Template%a% extends Latte\Runtime\Template

<?php
$_input = is_object($form[$name]) ? $form[$name] : end($this->global->formsStack)[$form[$name]];
echo LR\Filters::escapeHtml($_input->getError());
echo LR\Filters::escapeHtmlText($_input->getError());
?>

<?php
Expand Down Expand Up @@ -106,7 +99,7 @@ class Template%a% extends Latte\Runtime\Template
foreach ($form['sex']->items as $key => $label) {
?> <?php if ($_label = end($this->global->formsStack)["sex"]->getLabelPart($key)) echo $_label->startTag() ?> <?php
echo end($this->global->formsStack)["sex"]->getControlPart($key) /* line 32 */ ?> <?php
echo LR\Filters::escapeHtml($label) /* line 32 */;
echo LR\Filters::escapeHtmlText($label) /* line 32 */;
if ($_label) echo $_label->endTag() ?>

<label title=hello<?php
Expand Down Expand Up @@ -164,7 +157,7 @@ class Template%a% extends Latte\Runtime\Template
foreach ($form['checklist']->items as $key => $label) {
?> <?php if ($_label = end($this->global->formsStack)["checklist"]->getLabelPart($key)) echo $_label->startTag() ?> <?php
echo end($this->global->formsStack)["checklist"]->getControlPart($key) /* line 50 */ ?> <?php
echo LR\Filters::escapeHtml($label) /* line 50 */;
echo LR\Filters::escapeHtmlText($label) /* line 50 */;
if ($_label) echo $_label->endTag() ?>

<label<?php
Expand Down Expand Up @@ -243,5 +236,4 @@ class Template%a% extends Latte\Runtime\Template

<?php
}

}
%A%

0 comments on commit 90cdc20

Please sign in to comment.