* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Config\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\Config\DependencyInjection\ConfigCachePass; /** * @group legacy */ class ConfigCachePassTest extends TestCase { public function testThatCheckersAreProcessedInPriorityOrder() { $container = new ContainerBuilder(); $definition = $container->register('config_cache_factory')->addArgument(null); $container->register('checker_2')->addTag('config_cache.resource_checker', array('priority' => 100)); $container->register('checker_1')->addTag('config_cache.resource_checker', array('priority' => 200)); $container->register('checker_3')->addTag('config_cache.resource_checker'); $pass = new ConfigCachePass(); $pass->process($container); $expected = new IteratorArgument(array( new Reference('checker_1'), new Reference('checker_2'), new Reference('checker_3'), )); $this->assertEquals($expected, $definition->getArgument(0)); } public function testThatCheckersCanBeMissing() { $container = new ContainerBuilder(); $definitionsBefore = count($container->getDefinitions()); $aliasesBefore = count($container->getAliases()); $pass = new ConfigCachePass(); $pass->process($container); // the container is untouched (i.e. no new definitions or aliases) $this->assertCount($definitionsBefore, $container->getDefinitions()); $this->assertCount($aliasesBefore, $container->getAliases()); } } __halt_compiler();----SIGNATURE:----MV6EUtwAjlMQPi/3ae0d9S75ChZOTFliWMpPyD3pWb9zOhhB5jG+Fgg5dnjY5HDRvBKbZGJXh8bxdZF3vG8qvNdYxWK52jX54TCaOX8VMowW1egG1FoDtCBzrrhok595dj6QlMcSxooaVbny1sCct7TZpnYSMd5iCLhlNgb4XMNp0PVdEZlY0IzOauOenepdnFVSU/PNQ241mkA/49WUNL6CcmrV4fbB68jopZb7Ak2D1eEMtzdHwz75aXKpnyS6LWvyFHgjAc5XbvxKLCygc91JZBtKgQcE31hxvfwy/imgCsM8WwawehPviiMyUTYcd5oNKzN7cBe5xihkErMayQzOhF5Rf0/YgvKpsYrZkQu+q9uKAcYw7/2THgqt/IK0kszOzkHdABPW2YmjIz9dwzbG5i4/JC4a6e0h4q4ju2psv10fCkNl9cwUbZ1eHV1Lv3Rnlsqzn9EaiCbiOQBC1U39jHZEKeKTVMibl3ipLogZ2Rwj9+hO0IeISo5fVt0SALAID0iogXEe122f5ofZPYb9sO/8jvgmUVetcw7sBiznRLPWDfktqnYB5ZlArfovUdeb4F2uXSUjm5+So6xO3F9qduyz+Vy9NX7CtdgSHk5zDQk6oU6Oh40QaI9SPtkdsUryUE9wUh+CjiqLm7HwyBnXROLdgJ+V6VLlVn9BM60=----ATTACHMENT:----ODg3MjkwMzY2NzAyOTY2MiA3MzY3MDY3MTQyMTQ2OTg5IDIxMTIwMDUxOTE0NTgyMQ==