Skip to content

Commit

Permalink
Merge branch '4.1'
Browse files Browse the repository at this point in the history
* 4.1:
  [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
  • Loading branch information
nicolas-grekas committed Jun 29, 2018
2 parents 83232f8 + 5f0eae6 commit 0e9ded3
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 9 deletions.
Expand Up @@ -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) {
Expand Down
Expand Up @@ -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;

/**
Expand Down Expand Up @@ -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__))
Expand Down
Expand Up @@ -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
Expand Down
Expand Up @@ -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
Expand Down
Expand Up @@ -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
Expand Down
Expand Up @@ -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);

Expand Down
Expand Up @@ -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'));
Expand Down
Expand Up @@ -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));
}
Expand Down
Expand Up @@ -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;
Expand Down

0 comments on commit 0e9ded3

Please sign in to comment.