Skip to content

Commit 90cdc20

Browse files
committed
tests: compatibility with Latte master
1 parent af79d39 commit 90cdc20

4 files changed

Lines changed: 9 additions & 33 deletions

File tree

src/Bridges/FormsLatte/FormMacros.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public function macroForm(MacroNode $node, PhpWriter $writer)
5858
if ($name === FALSE) {
5959
throw new CompileException('Missing form name in ' . $node->getNotation());
6060
}
61-
$node->replaced = true;
61+
$node->replaced = TRUE;
6262
$node->tokenizer->reset();
6363
return $writer->write(
6464
"/* line $node->startLine */\n"

tests/Forms.Latte/expected/FormMacros.button.phtml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,4 @@
11
<?php
2-
// source: %A%
3-
4-
class Template%a% extends Latte\Runtime\Template
5-
{
6-
7-
function render()
8-
{
92
%A%
103
$form = $_form = $this->global->formsStack[] = $this->global->uiControl["myForm"];
114
?><form<?php
@@ -29,5 +22,4 @@ class Template%a% extends Latte\Runtime\Template
2922
?></form>
3023
<?php
3124
}
32-
33-
}
25+
%A%

tests/Forms.Latte/expected/FormMacros.formContainer.phtml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,4 @@
11
<?php
2-
// source: %A%
3-
4-
class Template%a% extends Latte\Runtime\Template
5-
{
6-
7-
function render()
8-
{
92
%A%
103
echo Nette\Bridges\FormsLatte\Runtime::renderFormBegin($form = $_form = $this->global->formsStack[] = $this->global->uiControl["myForm"], []);
114
?>
@@ -89,5 +82,4 @@ class Template%a% extends Latte\Runtime\Template
8982

9083
<?php
9184
}
92-
93-
}
85+
%A%

tests/Forms.Latte/expected/FormMacros.forms.phtml

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,4 @@
11
<?php
2-
// source: %A%
3-
4-
class Template%a% extends Latte\Runtime\Template
5-
{
6-
7-
function render()
8-
{
92
%A%
103
/* line 1 */
114
echo Nette\Bridges\FormsLatte\Runtime::renderFormBegin($form = $_form = $this->global->formsStack[] = $this->global->uiControl["myForm"], ['id' => 'myForm', 'class'=>"ajax"]);
@@ -23,12 +16,12 @@ class Template%a% extends Latte\Runtime\Template
2316
echo $_input->getControl()->addAttributes(['title' => 'Hello', 'size' => 10]) /* line 4 */ ?>
2417

2518
<?php
26-
echo LR\Filters::escapeHtml($_input->getError());
19+
echo LR\Filters::escapeHtmlText($_input->getError());
2720
?>
2821

2922
<?php
3023
$_input = is_object($name) ? $name : end($this->global->formsStack)[$name];
31-
echo LR\Filters::escapeHtml($_input->getError());
24+
echo LR\Filters::escapeHtmlText($_input->getError());
3225
?>
3326

3427

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

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

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

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

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

244237
<?php
245238
}
246-
247-
}
239+
%A%

0 commit comments

Comments
 (0)