8000 Merge branch '6.4' into 7.0 · symfony/symfony@9e248b8 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9e248b8

Browse files
Merge branch '6.4' into 7.0
* 6.4: - [FrameworkBundle] fix tests [FrameworkBundle] Fix legacy test [WebProfilerBundle] Improve minify test after JS refactor [HttpKernel] Do not use ContainerAwareInterface anymore Allows to change element for form_help block
2 parents 1265bc5 + 62ede8f commit 9e248b8

File tree

4 files changed

+48
-5
lines changed

src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,9 +329,9 @@
329329
{% block form_help -%}
330330
{%- if help is not empty -%}
331331
{%- set help_attr = help_attr|merge({class: (help_attr.class|default('') ~ ' help-text')|trim}) -%}
332-
<div id="{{ id }}_help"{% with { attr: help_attr } %}{{ block('attributes') }}{% endwith %}>
332+
<{{ element|default('div') }} id="{{ id }}_help"{% with { attr: help_attr } %}{{ block('attributes') }}{% endwith %}>
333333
{{- block('form_help_content') -}}
334-
</div>
334+
</{{ element|default('div') }}>
335335
{%- endif -%}
336336
{%- endblock form_help %}
337337

src/Symfony/Bundle/FrameworkBundle/Tests/Controller/ControllerResolverTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use Psr\Log\LoggerInterface;
1616
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
1717
use Symfony\Bundle\FrameworkBundle\Controller\ControllerResolver;
18+
use Symfony\Bundle\FrameworkBundle\Tests\Fixtures\ContainerAwareController;
1819
use Symfony\Component\DependencyInjection\Container;
1920
use Symfony\Component\DependencyInjection\ContainerInterface;
2021
use Symfony\Component\HttpFoundation\Request;
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Symfony\Bundle\FrameworkBundle\Tests\Fixtures;
13+
14+
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
15+
use Symfony\Component\DependencyInjection\ContainerInterface;
16+
17+
class ContainerAwareController implements ContainerAwareInterface
18+
{
19+
private ?ContainerInterface $container = null;
20+
21+
public function setContainer(?ContainerInterface $container): void
22+
{
23+
$this->container = $container;
24+
}
25+
26+
public function getContainer(): ?ContainerInterface
27+
{
28+
return $this->container;
29+
}
30+
31+
public function testAction()
32+
{
33+
}
34+
35+
public function __invoke()
36+
{
37+
}
38+
}

src/Symfony/Bundle/WebProfilerBundle/Tests/Resources/MinifyTest.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,12 @@ class MinifyTest extends TestCase
2323
public function testNoSingleLineComments()
2424
{
2525
$dir = \dirname(__DIR__, 2).'/Resources/views/Profiler';
26-
$message = 'There cannot be any single line comment in this file. Consider using multiple line comment. ';
27-
$this->assertTrue(2 === substr_count(file_get_contents($dir.'/base_js.html.twig'), '//'), $message);
28-
$this->assertTrue(0 === substr_count(file_get_contents($dir.'/toolbar.css.twig'), '//'), $message);
26+
27+
foreach (glob($dir.'/*js.html.twig') as $jsFile) {
28+
$fileContents = file_get_contents($dir.'/base_js.html.twig');
29+
$fileContents = str_replace('\'//\'', '', $fileContents);
30+
31+
$this->assertEquals(0, substr_count($fileContents, '//'), 'There cannot be any single line comment in "'.$jsFile.'". Consider using multiple line comment. ');
32+
}
2933
}
3034
}

0 commit comments

Comments
 (0)
0