* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\PropertyInfo\Tests\DependencyInjection; use PHPUnit\Framework\TestCase; use Symfony\Component\DependencyInjection\Argument\IteratorArgument; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Reference; use Symfony\Component\PropertyInfo\DependencyInjection\PropertyInfoPass; class PropertyInfoPassTest extends TestCase { /** * @dataProvider provideTags */ public function testServicesAreOrderedAccordingToPriority($index, $tag) { $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 = new IteratorArgument(array( new Reference('n1'), new Reference('n2'), new Reference('n3'), )); $this->assertEquals($expected, $definition->getArgument($index)); } 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'), ); } public function testReturningEmptyArrayWhenNoService() { $container = new ContainerBuilder(); $propertyInfoExtractorDefinition = $container->register('property_info') ->setArguments(array(array(), array(), array(), array())); $propertyInfoPass = new PropertyInfoPass(); $propertyInfoPass->process($container); $this->assertEquals(new IteratorArgument(array()), $propertyInfoExtractorDefinition->getArgument(0)); $this->assertEquals(new IteratorArgument(array()), $propertyInfoExtractorDefinition->getArgument(1)); $this->assertEquals(new IteratorArgument(array()), $propertyInfoExtractorDefinition->getArgument(2)); $this->assertEquals(new IteratorArgument(array()), $propertyInfoExtractorDefinition->getArgument(3)); } } __halt_compiler();----SIGNATURE:----Axz1HuLhxZp9bxYVfC5B0fFANsijNCLFrrAcLRspgS47qgbPPcL6lHU2KNkCGxlixQfekdwsDE/hIpC1VZ0jP86PwHbhZW3dKaQzhkFas9MoieGfYe1L5I7bZSWZiRirehpF0zDWo3xEOsfm/L3GrirYdIAbEyCm9Hg/4gPBwN3SiLoSiMBllIpKDeaXxAuBlje32BlE4U+oTBWv5iTRV8T6HnCbSDSoQuZH+kQjhRLbT7Fi0vazLl4tZ5cjFWnR5nmpowjLfxLhvWK4Byd16L8wNQCC+jzgiugNkPW+sEhIrNHRTuqef/+l+FVAPeldBumJ+Z7R7IUevY/0Kc4SiNuL55/Qq448DTTVAaA0+NvrTEnUGYkYevFu37AlmmozVgGDdwSm7Q0olXXs5cXOmV07Q7WkXNDB2WNgMxjuTrRKD4Pc1ZMzoSdm7Zliv568SZMLmJ1bd96oBb751fJR9Oxp9BHNReFoT501z6WE43IoNyr8G9wPd3YjmSbuMbQQLvxduAEcftuP/So3wUuTJhZC+pp8FX1fE3c3bdd/evTDahNEHUDhvXdHbdZCvjE90wFyvDb7PphLLHOWHX3EAQPhcIcI3EoY/sXI6gkAlNwDg09fV6kxGl/9oB6oLhmh4JKCQ7Z3G+6/JDREC7k6DYe5vY9QCh94NZTjFaZ+9KE=----ATTACHMENT:----MzE2MzQxMTMzMTI0NzgxOCA2MzM4MDMyMTMyMjYwMzM5IDg2MTA2NzYyNTU4ODE3MQ==