* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\DependencyInjection\Tests\Compiler; use PHPUnit\Framework\TestCase; use Symfony\Component\DependencyInjection\Argument\TaggedIteratorArgument; use Symfony\Component\DependencyInjection\Compiler\ResolveTaggedIteratorArgumentPass; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Reference; /** * @author Roland Franssen */ class ResolveTaggedIteratorArgumentPassTest extends TestCase { public function testProcess() { $container = new ContainerBuilder(); $container->register('a', 'stdClass')->addTag('foo'); $container->register('b', 'stdClass')->addTag('foo', array('priority' => 20)); $container->register('c', 'stdClass')->addTag('foo', array('priority' => 10)); $container->register('d', 'stdClass')->setProperty('foos', new TaggedIteratorArgument('foo')); (new ResolveTaggedIteratorArgumentPass())->process($container); $properties = $container->getDefinition('d')->getProperties(); $expected = new TaggedIteratorArgument('foo'); $expected->setValues(array(new Reference('b'), new Reference('c'), new Reference('a'))); $this->assertEquals($expected, $properties['foos']); } } __halt_compiler();----SIGNATURE:----uBOGJxwiqPV6N5D1CuOvASFctV95edAXf4bYDWIGDdPLVdROpYl30CM2SQQj8ZacO48EySLcvVGwqGz/8ISgKoq4MajfAJJKZn5PURg10/CZrMVv8Q6M0cVgl15/GkT0hNOaoeKRDlfVCVebjrt81qjk3C765e5UyifSG4oy/1ukUaPwvIMGrr1FMkMmPrmL4EG5w7rwBjVSPS5z55OmfO7GawRRXW34PME4HVQEgd7YdMTbvrhmMQ33IP0rJh1aL4dZ3h9tdMjY3o2RjGzkz4ZqPYd9kX0zGAT+/HRfFDp0mBr8uxSWRP2lokQcDi1wGbAaF1/DJbG5hg69PyxC/WDgnoz5rYQS3OvW/XRKyB4VeXZBV0gIgXtiqz6hrWgh2j8dWvYqPlFr8FTKjVsAJ2/s4zzUNzBdYtLAms1kz4Liu5QrXpEKI33KYfzcHzrZBrOqbRi5F918WHYF5rYfU0kEIQoSTEN3z7C8uZFFdDwdFrwkFrwG0RF8VY2pP3J3PZDjmsO5KRR8mWLzomYYTPoq6ZdnCuVIuh+5e7XSt5OMboZzCBbr2yVKsWoE4Apz8rp7qHMwoiT40YcV/exh6BZD5NwhbzTuQVyqoXFDBjxSkuclO/fmVW8TejDj2vMfPwG+2IueLiviusbHCigUAeFjOPdoflDIWp6ltqEehHo=----ATTACHMENT:----MzM3MzY1MTA5NTIyNzI0MSAzMzM1ODgxMTA2NzI2OTc2IDI4Nzc2MzA3ODA2NjA0NDM=