Merge branch '3.4' into 4.4
* 3.4: Relax tests to unlock change on master
This commit is contained in:
commit
a9ffbf4ccf
@ -33,14 +33,17 @@ class CachePoolClearerPassTest extends TestCase
|
||||
$container->setParameter('kernel.project_dir', 'foo');
|
||||
|
||||
$globalClearer = new Definition(Psr6CacheClearer::class);
|
||||
$globalClearer->setPublic(true);
|
||||
$container->setDefinition('cache.global_clearer', $globalClearer);
|
||||
|
||||
$publicPool = new Definition();
|
||||
$publicPool->setPublic(true);
|
||||
$publicPool->addArgument('namespace');
|
||||
$publicPool->addTag('cache.pool', ['clearer' => 'clearer_alias']);
|
||||
$container->setDefinition('public.pool', $publicPool);
|
||||
|
||||
$publicPool = new Definition();
|
||||
$publicPool->setPublic(true);
|
||||
$publicPool->addArgument('namespace');
|
||||
$publicPool->addTag('cache.pool', ['clearer' => 'clearer_alias', 'name' => 'pool2']);
|
||||
$container->setDefinition('public.pool2', $publicPool);
|
||||
@ -52,6 +55,7 @@ class CachePoolClearerPassTest extends TestCase
|
||||
$container->setDefinition('private.pool', $privatePool);
|
||||
|
||||
$clearer = new Definition();
|
||||
$clearer->setPublic(true);
|
||||
$container->setDefinition('clearer', $clearer);
|
||||
$container->setAlias('clearer_alias', 'clearer');
|
||||
|
||||
|
@ -30,14 +30,17 @@ class CachePoolClearerPassTest extends TestCase
|
||||
$container->setParameter('kernel.project_dir', 'foo');
|
||||
|
||||
$globalClearer = new Definition(Psr6CacheClearer::class);
|
||||
$globalClearer->setPublic(true);
|
||||
$container->setDefinition('cache.global_clearer', $globalClearer);
|
||||
|
||||
$publicPool = new Definition();
|
||||
$publicPool->setPublic(true);
|
||||
$publicPool->addArgument('namespace');
|
||||
$publicPool->addTag('cache.pool', ['clearer' => 'clearer_alias']);
|
||||
$container->setDefinition('public.pool', $publicPool);
|
||||
|
||||
$publicPool = new Definition();
|
||||
$publicPool->setPublic(true);
|
||||
$publicPool->addArgument('namespace');
|
||||
$publicPool->addTag('cache.pool', ['clearer' => 'clearer_alias', 'name' => 'pool2']);
|
||||
$container->setDefinition('public.pool2', $publicPool);
|
||||
@ -49,6 +52,7 @@ class CachePoolClearerPassTest extends TestCase
|
||||
$container->setDefinition('private.pool', $privatePool);
|
||||
|
||||
$clearer = new Definition();
|
||||
$clearer->setPublic(true);
|
||||
$container->setDefinition('clearer', $clearer);
|
||||
$container->setAlias('clearer_alias', 'clearer');
|
||||
|
||||
|
@ -58,12 +58,14 @@ class FormPassTest extends TestCase
|
||||
|
||||
$extDefinition = $container->getDefinition('form.extension');
|
||||
|
||||
$locator = $extDefinition->getArgument(0);
|
||||
$this->assertTrue(!$locator->isPublic() || $locator->isPrivate());
|
||||
$this->assertEquals(
|
||||
(new Definition(ServiceLocator::class, [[
|
||||
__CLASS__.'_Type1' => new ServiceClosureArgument(new Reference('my.type1')),
|
||||
__CLASS__.'_Type2' => new ServiceClosureArgument(new Reference('my.type2')),
|
||||
]]))->addTag('container.service_locator')->setPublic(false),
|
||||
$extDefinition->getArgument(0)
|
||||
$locator->setPublic(false)
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -35,12 +35,14 @@ class AddConstraintValidatorsPassTest extends TestCase
|
||||
$addConstraintValidatorsPass = new AddConstraintValidatorsPass();
|
||||
$addConstraintValidatorsPass->process($container);
|
||||
|
||||
$locator = $container->getDefinition((string) $validatorFactory->getArgument(0));
|
||||
$this->assertTrue(!$locator->isPublic() || $locator->isPrivate());
|
||||
$expected = (new Definition(ServiceLocator::class, [[
|
||||
Validator1::class => new ServiceClosureArgument(new Reference('my_constraint_validator_service1')),
|
||||
'my_constraint_validator_alias1' => new ServiceClosureArgument(new Reference('my_constraint_validator_service1')),
|
||||
Validator2::class => new ServiceClosureArgument(new Reference('my_constraint_validator_service2')),
|
||||
]]))->addTag('container.service_locator')->setPublic(false);
|
||||
$this->assertEquals($expected, $container->getDefinition((string) $validatorFactory->getArgument(0)));
|
||||
$this->assertEquals($expected, $locator->setPublic(false));
|
||||
}
|
||||
|
||||
public function testAbstractConstraintValidator()
|
||||
|
Reference in New Issue
Block a user