diff --git a/src/Symfony/Bridge/ProxyManager/LazyProxy/PhpDumper/ProxyDumper.php b/src/Symfony/Bridge/ProxyManager/LazyProxy/PhpDumper/ProxyDumper.php index cabae2517b69..0871c4ce9d70 100644 --- a/src/Symfony/Bridge/ProxyManager/LazyProxy/PhpDumper/ProxyDumper.php +++ b/src/Symfony/Bridge/ProxyManager/LazyProxy/PhpDumper/ProxyDumper.php @@ -54,7 +54,7 @@ public function getProxyFactoryCode(Definition $definition, $id, $factoryCode = $instantiation = 'return'; if ($definition->isShared()) { - $instantiation .= sprintf(' $this->%s[\'%s\'] =', $definition->isPublic() && !$definition->isPrivate() ? 'services' : 'privates', $id); + $instantiation .= sprintf(' $this->%s[\'%s\'] =', \method_exists(ContainerBuilder::class, 'addClassResource') || ($definition->isPublic() && !$definition->isPrivate()) ? 'services' : 'privates', $id); } if (null === $factoryCode) { diff --git a/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/PhpDumper/ProxyDumperTest.php b/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/PhpDumper/ProxyDumperTest.php index cd346dfe580e..e12b25fcb02f 100644 --- a/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/PhpDumper/ProxyDumperTest.php +++ b/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/PhpDumper/ProxyDumperTest.php @@ -13,6 +13,7 @@ use PHPUnit\Framework\TestCase; use Symfony\Bridge\ProxyManager\LazyProxy\PhpDumper\ProxyDumper; +use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Definition; /** @@ -98,7 +99,7 @@ public function getPrivatePublicDefinitions() array( (new Definition(__CLASS__)) ->setPublic(false), - 'privates', + \method_exists(ContainerBuilder::class, 'addClassResource') ? 'services' : 'privates', ), array( (new Definition(__CLASS__)) diff --git a/src/Symfony/Component/Form/Tests/Fixtures/Descriptor/default_option_with_normalizer.txt b/src/Symfony/Component/Form/Tests/Fixtures/Descriptor/default_option_with_normalizer.txt index c622057cdbdf..87d656a3fa1e 100644 --- a/src/Symfony/Component/Form/Tests/Fixtures/Descriptor/default_option_with_normalizer.txt +++ b/src/Symfony/Component/Form/Tests/Fixtures/Descriptor/default_option_with_normalizer.txt @@ -15,7 +15,7 @@ Symfony\Component\Form\Extension\Core\Type\ChoiceType (choice_translation_domain ---------------- --------------------%s Allowed values - %s ---------------- --------------------%s - Normalizer Closure { %s + Normalizer Closure%s{ %s parameters: 2 %s file: "%s%eExtension%eCore%eType%eChoiceType.php" line: "%s to %s" %s diff --git a/src/Symfony/Component/Form/Tests/Fixtures/Descriptor/overridden_option_with_default_closures.txt b/src/Symfony/Component/Form/Tests/Fixtures/Descriptor/overridden_option_with_default_closures.txt index 231d1319bbef..967d177c7e9c 100644 --- a/src/Symfony/Component/Form/Tests/Fixtures/Descriptor/overridden_option_with_default_closures.txt +++ b/src/Symfony/Component/Form/Tests/Fixtures/Descriptor/overridden_option_with_default_closures.txt @@ -8,12 +8,12 @@ Symfony\Component\Form\Tests\Console\Descriptor\FooType (empty_data) Default Value: null %s %s Closure(s): [ %s - Closure { %s + Closure%s{ %s parameters: 1 %s file: "%s%eExtension%eCore%eType%eFormType.php" line: "%s to %s" %s }, %s - Closure { %s + Closure%s{ %s parameters: 2 %s file: "%s%eTests%eConsole%eDescriptor%eAbstractDescriptorTest.php" line: "%s to %s" %s diff --git a/src/Symfony/Component/Form/Tests/Fixtures/Descriptor/required_option_with_allowed_values.txt b/src/Symfony/Component/Form/Tests/Fixtures/Descriptor/required_option_with_allowed_values.txt index da3e6c82d8b1..0d2e7f44d9bb 100644 --- a/src/Symfony/Component/Form/Tests/Fixtures/Descriptor/required_option_with_allowed_values.txt +++ b/src/Symfony/Component/Form/Tests/Fixtures/Descriptor/required_option_with_allowed_values.txt @@ -16,7 +16,7 @@ Symfony\Component\Form\Tests\Console\Descriptor\FooType (foo) "baz" %s ] %s ---------------- --------------------%s - Normalizer Closure { %s + Normalizer Closure%s{ %s parameters: 2 %s file: "%s%eTests%eConsole%eDescriptor%eAbstractDescriptorTest.php" line: "%s to %s" %s diff --git a/src/Symfony/Component/HttpFoundation/Session/Flash/FlashBagInterface.php b/src/Symfony/Component/HttpFoundation/Session/Flash/FlashBagInterface.php index 80e97f17cdff..f53c9dae6c0a 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Flash/FlashBagInterface.php +++ b/src/Symfony/Component/HttpFoundation/Session/Flash/FlashBagInterface.php @@ -24,7 +24,7 @@ interface FlashBagInterface extends SessionBagInterface * Adds a flash message for type. * * @param string $type - * @param string $message + * @param mixed $message */ public function add($type, $message); diff --git a/src/Symfony/Component/HttpFoundation/Tests/Session/Flash/FlashBagTest.php b/src/Symfony/Component/HttpFoundation/Tests/Session/Flash/FlashBagTest.php index c4e75b1b18b4..a146b75508cf 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/Session/Flash/FlashBagTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/Session/Flash/FlashBagTest.php @@ -74,6 +74,18 @@ public function testPeek() $this->assertEquals(array('A previous flash message'), $this->bag->peek('notice')); } + public function testAdd() + { + $tab = array('bar' => 'baz'); + $this->bag->add('string_message', 'lorem'); + $this->bag->add('object_message', new \stdClass()); + $this->bag->add('array_message', $tab); + + $this->assertEquals(array('lorem'), $this->bag->get('string_message')); + $this->assertEquals(array(new \stdClass()), $this->bag->get('object_message')); + $this->assertEquals(array($tab), $this->bag->get('array_message')); + } + public function testGet() { $this->assertEquals(array(), $this->bag->get('non_existing')); diff --git a/src/Symfony/Component/Lock/Tests/Store/SemaphoreStoreTest.php b/src/Symfony/Component/Lock/Tests/Store/SemaphoreStoreTest.php index 97c93c786c97..7a10ac1f7e76 100644 --- a/src/Symfony/Component/Lock/Tests/Store/SemaphoreStoreTest.php +++ b/src/Symfony/Component/Lock/Tests/Store/SemaphoreStoreTest.php @@ -46,7 +46,7 @@ public function testResourceRemoval() private function getOpenedSemaphores() { - $lines = explode(PHP_EOL, trim(`ipcs -su`)); + $lines = explode(PHP_EOL, trim(`LC_ALL=C ipcs -su`)); if ('------ Semaphore Status --------' !== $lines[0]) { throw new \Exception('Failed to extract list of opend semaphores. Expect a Semaphore status, got '.implode(PHP_EOL, $lines)); } diff --git a/src/Symfony/Component/Validator/Tests/Constraints/RegexTest.php b/src/Symfony/Component/Validator/Tests/Constraints/RegexTest.php index 3291c77356f2..26ef1b27361a 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/RegexTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/RegexTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Constraints; +namespace Symfony\Component\Validator\Tests\Constraints; use PHPUnit\Framework\TestCase; use Symfony\Component\Validator\Constraints\Regex;