Upgrade 1-11.38

This commit is contained in:
xesmyd
2026-03-30 14:10:30 +02:00
parent f2a7e6d1fc
commit ac648ef29d
24665 changed files with 69682 additions and 2205004 deletions
@@ -11,51 +11,55 @@
namespace Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\Compiler;
use PHPUnit\Framework\TestCase;
use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\PropertyInfoPass;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Reference;
class PropertyInfoPassTest extends \PHPUnit_Framework_TestCase
class PropertyInfoPassTest extends TestCase
{
public function testServicesAreOrderedAccordingToPriority()
/**
* @dataProvider provideTags
*/
public function testServicesAreOrderedAccordingToPriority($index, $tag)
{
$services = array(
'n3' => array('tag' => array()),
'n1' => array('tag' => array('priority' => 200)),
'n2' => array('tag' => array('priority' => 100)),
);
$container = new ContainerBuilder();
$definition = $container->register('property_info')->setArguments(array(null, null, null, null));
$container->register('n2')->addTag($tag, array('priority' => 100));
$container->register('n1')->addTag($tag, array('priority' => 200));
$container->register('n3')->addTag($tag);
$propertyInfoPass = new PropertyInfoPass();
$propertyInfoPass->process($container);
$expected = array(
new Reference('n1'),
new Reference('n2'),
new Reference('n3'),
);
$this->assertEquals($expected, $definition->getArgument($index));
}
$container = $this->getMock('Symfony\Component\DependencyInjection\ContainerBuilder', array('findTaggedServiceIds'));
$container->expects($this->any())
->method('findTaggedServiceIds')
->will($this->returnValue($services));
$propertyInfoPass = new PropertyInfoPass();
$method = new \ReflectionMethod(
'Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\PropertyInfoPass',
'findAndSortTaggedServices'
public function provideTags()
{
return array(
array(0, 'property_info.list_extractor'),
array(1, 'property_info.type_extractor'),
array(2, 'property_info.description_extractor'),
array(3, 'property_info.access_extractor'),
);
$method->setAccessible(true);
$actual = $method->invoke($propertyInfoPass, 'tag', $container);
$this->assertEquals($expected, $actual);
}
public function testReturningEmptyArrayWhenNoService()
{
$container = $this->getMock('Symfony\Component\DependencyInjection\ContainerBuilder', array('findTaggedServiceIds'));
$container = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerBuilder')->setMethods(array('findTaggedServiceIds'))->getMock();
$container->expects($this->any())
$container
->expects($this->any())
->method('findTaggedServiceIds')
->will($this->returnValue(array()));
->will($this->returnValue(array()))
;
$propertyInfoPass = new PropertyInfoPass();