8000 Merge branch '3.4' into 4.2 · symfony/symfony@7964eb8 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7964eb8

Browse files
Merge branch '3.4' into 4.2
* 3.4: fix tests [Validator] Added support for validation of giga values Fix Debug component tests
2 parents 813ad24 + 09aa533 commit 7964eb8

File tree

8 files changed

+17
-3
lines changed

8 files changed

+17
-3
lines changed

src/Symfony/Bundle/DebugBundle/Tests/DependencyInjection/DebugExtensionTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ private function compileContainer(ContainerBuilder $container)
5252
{
5353
$container->getCompilerPassConfig()->setOptimizationPasses([]);
5454
$container->getCompilerPassConfig()->setRemovingPasses([]);
55+
$container->getCompilerPassConfig()->setAfterRemovingPasses([]);
5556
$container->compile();
5657
}
5758
}

src/Symfony/Bundle/FrameworkBundle/Command/ContainerDebugCommand.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ protected function getContainerBuilder()
211211
$buildContainer = \Closure::bind(function () { return $this->buildContainer(); }, $kernel, \get_class($kernel));
212212
$container = $buildContainer();
213213
$container->getCompilerPassConfig()->setRemovingPasses([]);
214+
$container->getCompilerPassConfig()->setAfterRemovingPasses([]);
214215
$container->compile();
215216
} else {
216217
(new XmlFileLoader($container = new ContainerBuilder(), new FileLocator()))->load($kernel->getContainer()->getParameter('debug.container.dump'));

src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/CompleteConfigurationTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,7 @@ protected function getContainer($file)
522522

523523
$container->getCompilerPassConfig()->setOptimizationPasses([]);
524524
$container->getCompilerPassConfig()->setRemovingPasses([]);
525+
$container->getCompilerPassConfig()->setAfterRemovingPasses([]);
525526
$container->compile();
526527

527528
return $container;

src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/SecurityExtensionTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,7 @@ protected function getRawContainer()
410410

411411
$container->getCompilerPassConfig()->setOptimizationPasses([]);
412412
$container->getCompilerPassConfig()->setRemovingPasses([]);
413+
$container->getCompilerPassConfig()->setAfterRemovingPasses([]);
413414

414415
return $container;
415416
}

src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/TwigExtensionTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,7 @@ public function testRuntimeLoader()
296296
$container->register('foo', '%foo%')->addTag('twig.runtime');
297297
$container->addCompilerPass(new RuntimeLoaderPass(), PassConfig::TYPE_BEFORE_REMOVING);
298298
$container->getCompilerPassConfig()->setRemovingPasses([]);
299+
$container->getCompilerPassConfig()->setAfterRemovingPasses([]);
299300
$container->compile();
300301

301302
$loader = $container->getDefinition('twig.runtime_loader');
@@ -332,6 +333,7 @@ private function compileContainer(ContainerBuilder $container)
332333
{
333334
$container->getCompilerPassConfig()->setOptimizationPasses([]);
334335
$container->getCompilerPassConfig()->setRemovingPasses([]);
336+
$container->getCompilerPassConfig()->setAfterRemovingPasses([]);
335337
$container->compile();
336338
}
337339

src/Symfony/Component/Debug/Tests/FatalErrorHandler/ClassNotFoundFatalErrorHandlerTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ public function provideClassNotFoundData()
7171
{
7272
$autoloader = new ComposerClassLoader();
7373
$autoloader->add('Symfony\Component\Debug\Exception\\', realpath(__DIR__.'/../../Exception'));
74+
$autoloader->add('Symfony_Component_Debug_Tests_Fixtures', realpath(__DIR__.'/../../Tests/Fixtures'));
7475

7576
$debugClassLoader = new DebugClassLoader([$autoloader, 'loadClass']);
7677

@@ -101,6 +102,7 @@ public function provideClassNotFoundData()
101102
'message' => 'Class \'UndefinedFunctionException\' not found',
102103
],
103104
"/^Attempted to load class \"UndefinedFunctionException\" from the global namespace.\nDid you forget a \"use\" statement for .*\"Symfony\\\\Component\\\\Debug\\\\Exception\\\\UndefinedFunctionException\"\?$/",
105+
[$debugClassLoader, 'loadClass'],
104106
],
105107
[
106108
[
@@ -110,6 +112,7 @@ public function provideClassNotFoundData()
110112
'message' => 'Class \'PEARClass\' not found',
111113
],
112114
"/^Attempted to load class \"PEARClass\" from the global namespace.\nDid you forget a \"use\" statement for \"Symfony_Component_Debug_Tests_Fixtures_PEARClass\"\?$/",
115+
[$debugClassLoader, 'loadClass'],
113116
],
114117
[
115118
[
@@ -119,6 +122,7 @@ public function provideClassNotFoundData()
119122
'message' => 'Class \'Foo\\Bar\\UndefinedFunctionException\' not found',
120123
],
121124
"/^Attempted to load class \"UndefinedFunctionException\" from namespace \"Foo\\\\Bar\".\nDid you forget a \"use\" statement for .*\"Symfony\\\\Component\\\\Debug\\\\Exception\\\\UndefinedFunctionException\"\?$/",
125+
[$debugClassLoader, 'loadClass'],
122126
],
123127
[
124128
[

src/Symfony/Component/Validator/Constraints/File.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,10 @@ private function normalizeBinaryFormat($maxSize)
105105
$factors = [
106106
'k' => 1000,
107107
'ki' => 1 << 10,
108-
'm' => 1000000,
108+
'm' => 1000 * 1000,
109109
'mi' => 1 << 20,
110+
'g' => 1000 * 1000 * 1000,
111+
'gi' => 1 << 30,
110112
];
111113
if (ctype_digit((string) $maxSize)) {
112114
$this->maxSize = (int) $maxSize;

src/Symfony/Component/Validator/Tests/Constraints/FileTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,10 @@ public function provideValidSizes()
9797
['1MI', 1048576, true],
9898
['3m', 3000000, false],
9999
['3M', 3000000, false],
100+
['1gi', 1073741824, true],
101+
['1GI', 1073741824, true],
102+
['4g', 4000000000, false],
103+
['4G', 4000000000, false],
100104
];
101105
}
102106

@@ -107,8 +111,6 @@ public function provideInvalidSizes()
107111
['foo'],
108112
['1Ko'],
109113
['1kio'],
110-
['1G'],
111-
['1Gi'],
112114
];
113115
}
114116

0 commit comments

Comments
 (0)
0