Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[TwigBridge] Fix Bootstrap 4 form error layout #52373

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: 5.4
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fix failed test in PHP 8.2 + high-deps
  • Loading branch information
asispts committed Nov 15, 2023
commit 991255d2eced35330d2255f51a21cd8b8d616d6c
17 changes: 13 additions & 4 deletions src/Symfony/Bridge/Twig/Tests/Node/FormThemeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,18 @@ public function testCompile()
$this->registerTwigRuntimeLoader($environment, $formRenderer);
$compiler = new Compiler($environment);

// There's a different result when testing in Symfony 4 with PHP 8.2 + high-deps
// This workaround is used to deal with the difference.
$source = '[1 => "tpl1", 0 => "tpl2"]';
if ('["tpl1", "tpl2"]' === (new Compiler($environment))->subcompile($node->getNode('resources'))->getSource()) {
$source = '["tpl1", "tpl2"]';
}

$this->assertEquals(
sprintf(
'$this->env->getRuntime("Symfony\\\\Component\\\\Form\\\\FormRenderer")->setTheme(%s, [1 => "tpl1", 0 => "tpl2"], true);',
$this->getVariableGetter('form')
'$this->env->getRuntime("Symfony\\\\Component\\\\Form\\\\FormRenderer")->setTheme(%s, %s, true);',
$this->getVariableGetter('form'),
$source
),
trim($compiler->compile($node)->getSource())
);
Expand All @@ -72,8 +80,9 @@ public function testCompile()

$this->assertEquals(
sprintf(
'$this->env->getRuntime("Symfony\\\\Component\\\\Form\\\\FormRenderer")->setTheme(%s, [1 => "tpl1", 0 => "tpl2"], false);',
$this->getVariableGetter('form')
'$this->env->getRuntime("Symfony\\\\Component\\\\Form\\\\FormRenderer")->setTheme(%s, %s, false);',
$this->getVariableGetter('form'),
$source
),
trim($compiler->compile($node)->getSource())
);
Expand Down