* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\HttpKernel\Tests\DependencyInjection; use PHPUnit\Framework\TestCase; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Definition; use Symfony\Component\DependencyInjection\Reference; use Symfony\Component\HttpKernel\Controller\ArgumentResolver; use Symfony\Component\HttpKernel\DependencyInjection\ControllerArgumentValueResolverPass; class ControllerArgumentValueResolverPassTest extends TestCase { public function testServicesAreOrderedAccordingToPriority() { $services = array( 'n3' => array(array()), 'n1' => array(array('priority' => 200)), 'n2' => array(array('priority' => 100)), ); $expected = array( new Reference('n1'), new Reference('n2'), new Reference('n3'), ); $definition = new Definition(ArgumentResolver::class, array(null, array())); $container = new ContainerBuilder(); $container->setDefinition('argument_resolver', $definition); foreach ($services as $id => list($tag)) { $container->register($id)->addTag('controller.argument_value_resolver', $tag); } (new ControllerArgumentValueResolverPass())->process($container); $this->assertEquals($expected, $definition->getArgument(1)->getValues()); } public function testReturningEmptyArrayWhenNoService() { $definition = new Definition(ArgumentResolver::class, array(null, array())); $container = new ContainerBuilder(); $container->setDefinition('argument_resolver', $definition); (new ControllerArgumentValueResolverPass())->process($container); $this->assertEquals(array(), $definition->getArgument(1)->getValues()); } public function testNoArgumentResolver() { $container = new ContainerBuilder(); (new ControllerArgumentValueResolverPass())->process($container); $this->assertFalse($container->hasDefinition('argument_resolver')); } } __halt_compiler();----SIGNATURE:----Ytg5DpozWsuu7VWp9xTKtc6QmW+smoMmkHfasv+o/OmruvD50P24pTvoDQXs7+jEPCvbivDH8TmuYHQiLPw/3TcCAVVnPalTxkD/HAJUb7mdlulaoDnLHnc9CIXyOVMRwxcFm8RPmtuJfuHvap98noENhiMRlPoBV7TpgPv1KtExtpLKhRwwGpPHuSo85by5WGHUIOiffHzwGFcII6K1hVyLASE6bwGbDXHXvsPOKMbEBPtCNpMqn5C9tvwF8OiRl4NWX8F/Ap/QdcJso2nIIn7d/dd0AC1dpXN5dYVr0QnaEWOiyaPP8OocHP29IXVCdWI7sy8YOEt8EeetW2g60+BNgehBuIjSROQBvsb4oDCZuCDC3jMt3GFnxCoc2xy51uHR53Eym/OCsQdvnq7jHH0NjSyHQqRFjZbZwuKB4vdrzmTUc0ivAOqvVWCROuNYYKnhHFx7J0WK4MaAt0vJV+bPw1D6/URtMF5M+j2I0LFVKiNBG4b3iiwLaNzjlHEgJK5+QE2pMEsW6a6ehr0ra19ZcootyEr4xiN7fDJRxCJdOhS5ZPp6ERWpoTJ/tnmvuehYrdw0eftB3BvUqMpCdyYwuyPx41Qb1sLrwhxuO39uMvU6DgJU20keLJjvJiBsMBDDsuImtghSZOrHxvs6CoX+z11SPIN0NP07p+mjFXM=----ATTACHMENT:----MTE1OTI5MTQ2MDE3NTA0NCAyMTYxNDc2MDYwODkxMzY0IDQyMjEzNjY0MTE0OTM3Njg=