8000 Merge branch '3.4' into 4.0 · weaverryan/symfony@ae3b5de · GitHub
[go: up one dir, main page]

Skip to content

Commit ae3b5de

Browse files
Merge branch '3.4' into 4.0
* 3.4: [Lock][Process][FrameworkBundle] fix tests Display a nice error message if the form/serializer component is missing. [SecurityBundle] providerIds is undefined error when firewall provider is not specified [SecurityBundle] providerIds is undefined error when firewall provider is not specified [SecurityBundle] providerIds is undefined error when firewall provider is not specified Force phpunit-bridge update (bis) [Bridge/PhpUnit] Fix disabling global state preservation Incorrect dot on method loadChoices in upgrade doc
2 parents 0fb159e + 259ac66 commit ae3b5de

File tree

9 files changed

+31
-33
lines changed

9 files changed

+31
-33
lines changed

UPGRADE-4.0.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ Form
323323
```php
324324
class MyTimezoneType extends AbstractType
325325
{
326-
public function. getParent()
326+
public function getParent()
327327
{
328328
return TimezoneType::class;
329329
}

phpunit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env php
22
<?php
33

4-
// Cache-Id: https://github.com/symfony/phpunit-bridge/commit/3646664aa952fe13e9a612a726cbb38e02249793
4+
// Cache-Id: https://github.com/symfony/phpunit-bridge/commit/66ffffcd8a6bb23aec847c8bdfb918610399499a
55

66
if (!file_exists(__DIR__.'/vendor/symfony/phpunit-bridge/bin/simple-phpunit')) {
77
echo "Unable to find the `simple-phpunit` script in `vendor/symfony/phpunit-bridge/bin/`.\nPlease run `composer update` before running this command.\n";

src/Symfony/Bridge/PhpUnit/Legacy/SymfonyTestsListenerTrait.php

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,15 @@ public function startTestSuite($suite)
9797
$suiteName = $suite->getName();
9898
$this->testsWithWarnings = array();
9999

100+
foreach ($suite->tests() as $test) {
101+
if (!($test instanceof \PHPUnit_Framework_TestCase || $test instanceof TestCase)) {
102+
continue;
103+
}
104+
if (null === $Test::getPreserveGlobalStateSettings(get_class($test), $test->getName(false))) {
105+
$test->setPreserveGlobalState(false);
106+
}
107+
}
108+
100109
if (-1 === $this->state) {
101110
echo "Testing $suiteName\n";
102111
$this->state = 0;
@@ -132,10 +141,6 @@ public function startTestSuite($suite)
132141
if (in_array('dns-sensitive', $groups, true)) {
133142
DnsMock::register($test->getName());
134143
}
135-
} elseif (!($test instanceof \PHPUnit_Framework_TestCase || $test instanceof TestCase)) {
136-
// no-op
137-
} elseif (null === $Test::getPreserveGlobalStateSettings(get_class($test), $test->getName(false))) {
138-
$test->setPreserveGlobalState(false);
139144
}
140145
}
141146
}
@@ -146,8 +151,6 @@ public function startTestSuite($suite)
146151
|| isset($this->wasSkipped[$suiteName]['*'])
147152
|| isset($this->wasSkipped[$suiteName][$test->getName()])) {
148153
$skipped[] = $test;
149-
} elseif (null === $Test::getPreserveGlobalStateSettings(get_class($test), $test->getName(false))) {
150-
$test->setPreserveGlobalState(false);
151154
}
152155
}
153156
$suite->setTests($skipped);

src/Symfony/Bridge/PhpUnit/bin/simple-phpunit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*/
1212

1313
// Please update when phpunit needs to be reinstalled with fresh deps:
14-
// Cache-Id-Version: 2017-11-22 09:00 UTC
14+
// Cache-Id-Version: 2017-11-22 09:30 UTC
1515

1616
error_reporting(-1);
1717

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,6 @@ public function load(array $configs, ContainerBuilder $container)
137137
throw new LogicException('Translation support cannot be enabled as the Translation component is not installed.');
138138
}
139139

140-
if (!class_exists('Symfony\Component\Translation\Translator') && $this->isConfigEnabled($container, $config['validation'])) {
141-
throw new LogicException('Validation support cannot be enabled as the Translation component is not installed.');
142-
}
143-
144140
if (class_exists(Translator::class)) {
145141
$loader->load('identity_translator.xml');
146142
}
@@ -184,6 +180,10 @@ public function load(array $configs, ContainerBuilder $container)
184180
}
185181

186182
if ($this->isConfigEnabled($container, $config['form'])) {
183+
if (!class_exists('Symfony\Component\Form\Form')) {
184+
throw new LogicException('Form support cannot be enabled as the Form component is not installed.');
185+
}
186+
187187
$this->formConfigEnabled = true;
188188
$this->registerFormConfiguration($config, $container, $loader);
189189

@@ -231,6 +231,10 @@ public function load(array $configs, ContainerBuilder $container)
231231
$this->registerPropertyAccessConfiguration($config['property_access'], $container, $loader);
232232

233233
if ($this->isConfigEnabled($container, $config['serializer'])) {
234+
if (!class_exists('Symfony\Component\Serializer\Serializer')) {
235+
throw new LogicException('Serializer support cannot be enabled as the Serializer component is not installed.');
236+
}
237+
234238
$this->registerSerializerConfiguration($config['serializer'], $container, $loader);
235239
}
236240

@@ -923,6 +927,7 @@ private function registerTranslatorConfiguration(array $config, ContainerBuilder
923927
return 2 === substr_count($file->getBasename(), '.') && preg_match('/\.\w+$/', $file->getBasename());
924928
})
925929
->in($dirs)
930+
->sortByName()
926931
;
927932

928933
foreach ($finder as $file) {
@@ -1032,7 +1037,7 @@ private function registerValidatorMapping(ContainerBuilder $container, array $co
10321037

10331038
private function registerMappingFilesFromDir($dir, callable $fileRecorder)
10341039
{
1035-
foreach (Finder::create()->followLinks()->files()->in($dir)->name('/\.(xml|ya?ml)$/') as $file) {
1040+
foreach (Finder::create()->followLinks()->files()->in($dir)->name('/\.(xml|ya?ml)$/')->sortByName() as $file) {
10361041
$fileRecorder($file->getExtension(), $file->getRealPath());
10371042
}
10381043
}

src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ private function createFirewall(ContainerBuilder $container, $id, $firewall, &$a
349349
// Switch user listener
350350
if (isset($firewall['switch_user'])) {
351351
$listenerKeys[] = 'switch_user';
352-
$listeners[] = new Reference($this->createSwitchUserListener($container, $id, $firewall['switch_user'], $defaultProvider, $firewall['stateless']));
352+
$listeners[] = new Reference($this->createSwitchUserListener($container, $id, $firewall['switch_user'], $defaultProvider, $firewall['stateless'], $providerIds));
353353
}
354354

355355
// Access listener
@@ -594,7 +594,7 @@ private function createExceptionListener($container, $config, $id, $defaultEntry
594594
return $exceptionListenerId;
595595
}
596596

597-
private function createSwitchUserListener($container, $id, $config, $defaultProvider = null, $stateless)
597+
private function createSwitchUserListener($container, $id, $config, $defaultProvider, $stateless, $providerIds)
598598
{
599599
$userProvider = isset($config['provider']) ? $this->getUserProviderId($config['provider']) : $defaultProvider;
600600

src/Symfony/Bundle/SecurityBundle/composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"symfony/dom-crawler": "~3.4|~4.0",
3131
"symfony/event-dispatcher": "~3.4|~4.0",
3232
"symfony/form": "~3.4|~4.0",
33-
"symfony/framework-bundle": "~3.4|~4.0",
33+
"symfony/framework-bundle": "~3.4-rc1|~4.0-rc1",
3434
"symfony/http-foundation": "~3.4|~4.0",
3535
"symfony/translation": "~3.4|~4.0",
3636
"symfony/twig-bundle": "~3.4|~4.0",
@@ -40,7 +40,7 @@
4040
"symfony/var-dumper": "~3.4|~4.0",
4141
"symfony/yaml": "~3.4|~4.0",
4242
"symfony/expression-language": "~3.4|~4.0",
43-
"doctrine/doctrine-bundle": "~1.4",
43+
"doctrine/doctrine-bundle": "~1.5",
4444
"twig/twig": "~1.34|~2.4"
4545
},
4646
"conflict": {

src/Symfony/Component/Lock/Tests/Store/MemcachedStoreTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ public static function setupBeforeClass()
2626
{
2727
$memcached = new \Memcached();
2828
$memcached->addServer(getenv('MEMCACHED_HOST'), 11211);
29-
if (false === $memcached->getStats()) {
29+
$memcached->get('foo');
30+
$code = $memcached->getResultCode();
31+
32+
if (\Memcached::RES_SUCCESS !== $code && \Memcached::RES_NOTFOUND !== $code) {
3033
self::markTestSkipped('Unable to connect to the memcache host');
3134
}
3235
}

src/Symfony/Component/Process/Tests/ProcessTest.php

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1452,20 +1452,7 @@ public function testRawCommandLine()
14521452
)
14531453
14541454
EOTXT;
1455-
1456-
if (\PHP_VERSION_ID >= 70200) {
1457-
$expected = <<<EOTXT
1458-
Array
1459-
(
1460-
[0] => Standard input code
1461-
[1] => a
1462-
[2] =>
1463-
[3] => b
1464-
)
1465-
1466-
EOTXT;
1467-
}
1468-
$this->assertSame($expected, $p->getOutput());
1455+
$this->assertSame($expected, str_replace('Standard input code', '-', $p->getOutput()));
14691456
}
14701457

14711458
public function provideEscapeArgument()

0 commit comments

Comments
 (0)
0