E5F8 Merge branch '4.2' into 4.3 · symfony/symfony@f805fe3 · GitHub
[go: up one dir, main page]

Skip to content

Commit f805fe3

Browse files
Merge branch '4.2' into 4.3
* 4.2: fix tests [Validator] Added support for validation of giga values Fix Debug component tests
2 parents 9662246 + 7964eb8 commit f805fe3

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
@@ -86,6 +86,7 @@ private function compileContainer(ContainerBuilder $container)
8686
{
8787
$container->getCompilerPassConfig()->setOptimizationPasses([]);
8888
$container->getCompilerPassConfig()->setRemovingPasses([]);
89+
$container->getCompilerPassConfig()->setAfterRemovingPasses([]);
8990
$container->compile();
9091
}
9192
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@ protected function getContainerBuilder()
225225
$buildContainer = \Closure::bind(function () { return $this->buildContainer(); }, $kernel, \get_class($kernel));
226226
$container = $buildContainer();
227227
$container->getCompilerPassConfig()->setRemovingPasses([]);
228+
$container->getCompilerPassConfig()->setAfterRemovingPasses([]);
228229
$container->compile();
229230
} else {
230231
(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
@@ -659,6 +659,7 @@ protected function getContainer($file)
659659

660660
$container->getCompilerPassConfig()->setOptimizationPasses([]);
661661
$container->getCompilerPassConfig()->setRemovingPasses([]);
662+
$container->getCompilerPassConfig()->setAfterRemovingPasses([]);
662663
$container->compile();
663664

664665
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
@@ -299,6 +299,7 @@ public function testRuntimeLoader()
299299
$container->register('foo', '%foo%')->addTag('twig.runtime');
300300
$container->addCompilerPass(new RuntimeLoaderPass(), PassConfig::TYPE_BEFORE_REMOVING);
301301
$container->getCompilerPassConfig()->setRemovingPasses([]);
302+
$container->getCompilerPassConfig()->setAfterRemovingPasses([]);
302303
$container->compile();
303304

304305
$loader = $container->getDefinition('twig.runtime_loader');
@@ -335,6 +336,7 @@ private function compileContainer(ContainerBuilder $container)
335336
{
336337
$container->getCompilerPassConfig()->setOptimizationPasses([]);
337338
$container->getCompilerPassConfig()->setRemovingPasses([]);
339+
$container->getCompilerPassConfig()->setAfterRemovingPasses([]);
338340
$container->compile();
339341
}
340342

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