Merge branch '3.4' into 4.0

* 3.4:
  [HttpFoundation] update phpdoc of FlashBagInterface::add()
  [ProxyManagerBridge] Fix support of private services (bis)
  bug #27701 [SecurityBundle] Dont throw if "security.http_utils" is not found (nicolas-grekas)
  [Form] relax fixtures for forward compat
  [Validator] Fix the namespace of RegexTest
  [Lock] fix locale dependent test case
This commit is contained in:
Nicolas Grekas 2018-06-29 18:29:32 +02:00
commit 44b573fd2d
9 changed files with 22 additions and 9 deletions

View File

@ -54,7 +54,7 @@ class ProxyDumper implements DumperInterface
$instantiation = 'return'; $instantiation = 'return';
if ($definition->isShared()) { 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) { if (null === $factoryCode) {

View File

@ -13,6 +13,7 @@ namespace Symfony\Bridge\ProxyManager\Tests\LazyProxy\PhpDumper;
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
use Symfony\Bridge\ProxyManager\LazyProxy\PhpDumper\ProxyDumper; use Symfony\Bridge\ProxyManager\LazyProxy\PhpDumper\ProxyDumper;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition; use Symfony\Component\DependencyInjection\Definition;
/** /**
@ -98,7 +99,7 @@ class ProxyDumperTest extends TestCase
array( array(
(new Definition(__CLASS__)) (new Definition(__CLASS__))
->setPublic(false), ->setPublic(false),
'privates', \method_exists(ContainerBuilder::class, 'addClassResource') ? 'services' : 'privates',
), ),
array( array(
(new Definition(__CLASS__)) (new Definition(__CLASS__))

View File

@ -15,7 +15,7 @@ Symfony\Component\Form\Extension\Core\Type\ChoiceType (choice_translation_domain
---------------- --------------------%s ---------------- --------------------%s
Allowed values - %s Allowed values - %s
---------------- --------------------%s ---------------- --------------------%s
Normalizer Closure { %s Normalizer Closure%s{ %s
parameters: 2 %s parameters: 2 %s
file: "%s%eExtension%eCore%eType%eChoiceType.php" file: "%s%eExtension%eCore%eType%eChoiceType.php"
line: "%s to %s" %s line: "%s to %s" %s

View File

@ -8,12 +8,12 @@ Symfony\Component\Form\Tests\Console\Descriptor\FooType (empty_data)
Default Value: null %s Default Value: null %s
%s %s
Closure(s): [ %s Closure(s): [ %s
Closure { %s Closure%s{ %s
parameters: 1 %s parameters: 1 %s
file: "%s%eExtension%eCore%eType%eFormType.php" file: "%s%eExtension%eCore%eType%eFormType.php"
line: "%s to %s" %s line: "%s to %s" %s
}, %s }, %s
Closure { %s Closure%s{ %s
parameters: 2 %s parameters: 2 %s
file: "%s%eTests%eConsole%eDescriptor%eAbstractDescriptorTest.php" file: "%s%eTests%eConsole%eDescriptor%eAbstractDescriptorTest.php"
line: "%s to %s" %s line: "%s to %s" %s

View File

@ -16,7 +16,7 @@ Symfony\Component\Form\Tests\Console\Descriptor\FooType (foo)
"baz" %s "baz" %s
] %s ] %s
---------------- --------------------%s ---------------- --------------------%s
Normalizer Closure { %s Normalizer Closure%s{ %s
parameters: 2 %s parameters: 2 %s
file: "%s%eTests%eConsole%eDescriptor%eAbstractDescriptorTest.php" file: "%s%eTests%eConsole%eDescriptor%eAbstractDescriptorTest.php"
line: "%s to %s" %s line: "%s to %s" %s

View File

@ -24,7 +24,7 @@ interface FlashBagInterface extends SessionBagInterface
* Adds a flash message for type. * Adds a flash message for type.
* *
* @param string $type * @param string $type
* @param string $message * @param mixed $message
*/ */
public function add($type, $message); public function add($type, $message);

View File

@ -74,6 +74,18 @@ class FlashBagTest extends TestCase
$this->assertEquals(array('A previous flash message'), $this->bag->peek('notice')); $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() public function testGet()
{ {
$this->assertEquals(array(), $this->bag->get('non_existing')); $this->assertEquals(array(), $this->bag->get('non_existing'));

View File

@ -46,7 +46,7 @@ class SemaphoreStoreTest extends AbstractStoreTest
private function getOpenedSemaphores() 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]) { if ('------ Semaphore Status --------' !== $lines[0]) {
throw new \Exception('Failed to extract list of opend semaphores. Expect a Semaphore status, got '.implode(PHP_EOL, $lines)); throw new \Exception('Failed to extract list of opend semaphores. Expect a Semaphore status, got '.implode(PHP_EOL, $lines));
} }

View File

@ -9,7 +9,7 @@
* file that was distributed with this source code. * file that was distributed with this source code.
*/ */
namespace Constraints; namespace Symfony\Component\Validator\Tests\Constraints;
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
use Symfony\Component\Validator\Constraints\Regex; use Symfony\Component\Validator\Constraints\Regex;