Skip to content

Commit 9aaaf25

Browse files
Merge branch '7.2' into 7.3
* 7.2: Fix php.net links fix version number in deprecation [DoctrineBridge] Restore compatibility with Doctrine ODM by validating $class object type chore: Increase minimum version of type-info component [FrameworkBundle] Add functional tests for the `ContainerLintCommand` command Fix precision loss when rounding large integers in `NumberToLocalizedStringTransformer`
2 parents 91905f2 + a48b5a3 commit 9aaaf25

File tree

2 files changed

+56
-1
lines changed

2 files changed

+56
-1
lines changed
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
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\Functional;
13+
14+
use Symfony\Bundle\FrameworkBundle\Console\Application;
15+
use Symfony\Component\Console\Tester\CommandTester;
16+
17+
/**
18+
* @group functional
19+
*/
20+
class ContainerLintCommandTest extends AbstractWebTestCase
21+
{
22+
private Application $application;
23+
24+
/**
25+
* @dataProvider containerLintProvider
26+
*/
27+
public function testLintContainer(string $configFile, string $expectedOutput)
28+
{
29+
$kernel = static::createKernel([
30+
'test_case' => 'ContainerDebug',
31+
'root_config' => $configFile,
32+
'debug' => true,
33+
]);
34+
$this->application = new Application($kernel);
35+
36+
$tester = $this->createCommandTester();
37+
$exitCode = $tester->execute([]);
38+
39+
$this->assertSame(0, $exitCode);
40+
$this->assertStringContainsString($expectedOutput, $tester->getDisplay());
41+
}
42+
43+
public static function containerLintProvider(): array
44+
{
45+
return [
46+
'default container' => ['config.yml', 'The container was linted successfully'],
47+
'missing dump file' => ['no_dump.yml', 'The container was linted successfully'],
48+
];
49+
}
50+
51+
private function createCommandTester(): CommandTester
52+
{
53+
return new CommandTester($this->application->get('lint:container'));
54+
}
55+
}

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
"symfony/string": "^6.4|^7.0",
6666
"symfony/translation": "^7.3",
6767
"symfony/twig-bundle": "^6.4|^7.0",
68-
"symfony/type-info": "^7.1",
68+
"symfony/type-info": "^7.1.8",
6969
"symfony/validator": "^6.4|^7.0",
7070
"symfony/workflow": "^7.3",
7171
"symfony/yaml": "^6.4|^7.0",

0 commit comments

Comments
 (0)