Skip to content

Commit 8b394f1

Browse files
committed
tests: Latte 2.4 generates short array syntax
1 parent 532059a commit 8b394f1

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"require-dev": {
2323
"nette/di": "~2.3",
2424
"nette/tester": "~1.3",
25-
"latte/latte": "~2.3, >=2.3.2",
25+
"latte/latte": "~2.4",
2626
"tracy/tracy": "~2.2"
2727
},
2828
"conflict": {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//
44
// main template
55
//
6-
echo Nette\Bridges\FormsLatte\Runtime::renderFormBegin($form = $_form = $_control["myForm"], array()) ?>
6+
echo Nette\Bridges\FormsLatte\Runtime::renderFormBegin($form = $_form = $_control["myForm"], []) ?>
77

88
<table>
99
<tr>

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<?php
22
%A%
3-
echo Nette\Bridges\FormsLatte\Runtime::renderFormBegin($form = $_form = $_control["myForm"], array('id' => 'myForm', 'class'=>"ajax")) ?>
3+
echo Nette\Bridges\FormsLatte\Runtime::renderFormBegin($form = $_form = $_control["myForm"], ['id' => 'myForm', 'class'=>"ajax"]) ?>
44

5-
<?php $iterations = 0; foreach (array('id', 'username', 'select', 'area', 'send') as $name) { ?>
5+
<?php $iterations = 0; foreach (['id', 'username', 'select', 'area', 'send'] as $name) { ?>
66
<?php $_input = is_object($name) ? $name : $_form[$name]; if ($_label = $_input->getLabel()) echo $_label ?>
77

8-
<?php $_input = is_object($name) ? $name : $_form[$name]; echo $_input->getControl()->addAttributes(array('title' => 'Hello', 'size' => 10)) ?>
8+
<?php $_input = is_object($name) ? $name : $_form[$name]; echo $_input->getControl()->addAttributes(['title' => 'Hello', 'size' => 10]) ?>
99

1010
<?php echo Latte\Runtime\Filters::escapeHtml($_input->getError(), ENT_NOQUOTES) ?>
1111

@@ -14,8 +14,8 @@ echo Nette\Bridges\FormsLatte\Runtime::renderFormBegin($form = $_form = $_contro
1414

1515
<br>
1616

17-
<?php $_input = is_object($form[$name]) ? $form[$name] : $_form[$form[$name]]; if ($_label = $_input->getLabel()) echo $_label->addAttributes(array('title' => 'hello'))->startTag() ?>
18-
<?php $_input = is_object($form[$name]) ? $form[$name] : $_form[$form[$name]]; echo $_input->getControl()->addAttributes(array('title' => 'Hello', 'size' => 10)) ?>
17+
<?php $_input = is_object($form[$name]) ? $form[$name] : $_form[$form[$name]]; if ($_label = $_input->getLabel()) echo $_label->addAttributes(['title' => 'hello'])->startTag() ?>
18+
<?php $_input = is_object($form[$name]) ? $form[$name] : $_form[$form[$name]]; echo $_input->getControl()->addAttributes(['title' => 'Hello', 'size' => 10]) ?>
1919
<?php if ($_label) echo $_label->endTag() ?>
2020

2121
<?php $_input = is_object($form[$name]) ? $form[$name] : $_form[$form[$name]]; echo Latte\Runtime\Filters::escapeHtml($_input->getError(), ENT_NOQUOTES) ?>
@@ -45,7 +45,7 @@ echo Nette\Bridges\FormsLatte\Runtime::renderFormBegin($form = $_form = $_contro
4545

4646

4747

48-
<?php echo Nette\Bridges\FormsLatte\Runtime::renderFormBegin($form = $_form = $_control["myForm"], array()) ;echo Nette\Bridges\FormsLatte\Runtime::renderFormEnd($_form) ?>
48+
<?php echo Nette\Bridges\FormsLatte\Runtime::renderFormBegin($form = $_form = $_control["myForm"], []) ;echo Nette\Bridges\FormsLatte\Runtime::renderFormEnd($_form) ?>
4949

5050

5151

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
%A%
3-
echo Nette\Bridges\FormsLatte\Runtime::renderFormBegin($form = $_form = $_control["myForm"], array()) ;echo Nette\Bridges\FormsLatte\Runtime::renderFormEnd($_form) ?>
3+
echo Nette\Bridges\FormsLatte\Runtime::renderFormBegin($form = $_form = $_control["myForm"], []) ;echo Nette\Bridges\FormsLatte\Runtime::renderFormEnd($_form) ?>
44

55

66
<form<?php echo Nette\Bridges\FormsLatte\Runtime::renderFormBegin($form = $_form = $_control["myForm"], array (

0 commit comments

Comments
 (0)