|
15 | 15 | use Symfony\Bridge\Twig\Node\SearchAndRenderBlockNode; |
16 | 16 | use Twig\Compiler; |
17 | 17 | use Twig\Environment; |
| 18 | +use Twig\Extension\CoreExtension; |
18 | 19 | use Twig\Loader\LoaderInterface; |
19 | 20 | use Twig\Node\Expression\ArrayExpression; |
20 | 21 | use Twig\Node\Expression\ConditionalExpression; |
@@ -226,8 +227,9 @@ public function testCompileLabelWithLabelThatEvaluatesToNull() |
226 | 227 | // https://github.com/symfony/symfony/issues/5029 |
227 | 228 | $this->assertEquals( |
228 | 229 | sprintf( |
229 | | - '$this->env->getRuntime(\'Symfony\Component\Form\FormRenderer\')->searchAndRenderBlock(%s, \'label\', (twig_test_empty($_label_ = ((true) ? (null) : (null))) ? [] : ["label" => $_label_]))', |
230 | | - $this->getVariableGetter('form') |
| 230 | + '$this->env->getRuntime(\'Symfony\Component\Form\FormRenderer\')->searchAndRenderBlock(%s, \'label\', (%s($_label_ = ((true) ? (null) : (null))) ? [] : ["label" => $_label_]))', |
| 231 | + $this->getVariableGetter('form'), |
| 232 | + method_exists(CoreExtension::class, 'testEmpty') ? 'CoreExtension::testEmpty' : 'twig_test_empty' |
231 | 233 | ), |
232 | 234 | trim($compiler->compile($node)->getSource()) |
233 | 235 | ); |
@@ -263,8 +265,9 @@ public function testCompileLabelWithLabelThatEvaluatesToNullAndAttributes() |
263 | 265 | // https://github.com/symfony/symfony/issues/5029 |
264 | 266 | $this->assertEquals( |
265 | 267 | sprintf( |
266 | | - '$this->env->getRuntime(\'Symfony\Component\Form\FormRenderer\')->searchAndRenderBlock(%s, \'label\', ["foo" => "bar", "label" => "value in attributes"] + (twig_test_empty($_label_ = ((true) ? (null) : (null))) ? [] : ["label" => $_label_]))', |
267 | | - $this->getVariableGetter('form') |
| 268 | + '$this->env->getRuntime(\'Symfony\Component\Form\FormRenderer\')->searchAndRenderBlock(%s, \'label\', ["foo" => "bar", "label" => "value in attributes"] + (%s($_label_ = ((true) ? (null) : (null))) ? [] : ["label" => $_label_]))', |
| 269 | + $this->getVariableGetter('form'), |
| 270 | + method_exists(CoreExtension::class, 'testEmpty') ? 'CoreExtension::testEmpty' : 'twig_test_empty' |
268 | 271 | ), |
269 | 272 | trim($compiler->compile($node)->getSource()) |
270 | 273 | ); |
|
0 commit comments