Merge branch '4.0' into 4.1
* 4.0: [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:
commit
5f0eae682f
@ -54,7 +54,7 @@ class ProxyDumper implements DumperInterface
|
||||
$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) {
|
||||
|
@ -13,6 +13,7 @@ namespace Symfony\Bridge\ProxyManager\Tests\LazyProxy\PhpDumper;
|
||||
|
||||
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 @@ class ProxyDumperTest extends TestCase
|
||||
array(
|
||||
(new Definition(__CLASS__))
|
||||
->setPublic(false),
|
||||
'privates',
|
||||
\method_exists(ContainerBuilder::class, 'addClassResource') ? 'services' : 'privates',
|
||||
),
|
||||
array(
|
||||
(new Definition(__CLASS__))
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
|
||||
|
@ -74,6 +74,18 @@ class FlashBagTest extends TestCase
|
||||
$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'));
|
||||
|
@ -46,7 +46,7 @@ class SemaphoreStoreTest extends AbstractStoreTest
|
||||
|
||||
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));
|
||||
}
|
||||
|
@ -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;
|
||||
|
Reference in New Issue
Block a user