public function testServicesAreOrderedAccordingToPriority()
{
$services = array('n3' => array('tag' => array()), 'n1' => array('tag' => array('priority' => 200)), 'n2' => array('tag' => array('priority' => 100)));
$expected = array(new Reference('n1'), new Reference('n2'), new Reference('n3'));
$container = $this->getMockBuilder('Symfony\\Component\\DependencyInjection\\ContainerBuilder')->setMethods(array('findTaggedServiceIds'))->getMock();
$container->expects($this->any())->method('findTaggedServiceIds')->will($this->returnValue($services));
$serializerPass = new SerializerPass();
$method = new \ReflectionMethod('Symfony\\Bundle\\FrameworkBundle\\DependencyInjection\\Compiler\\SerializerPass', 'findAndSortTaggedServices');
$method->setAccessible(true);
$actual = $method->invoke($serializerPass, 'tag', $container);
$this->assertEquals($expected, $actual);
}