* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Translation\Tests\DependencyInjection; use PHPUnit\Framework\TestCase; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Reference; use Symfony\Component\Translation\DependencyInjection\TranslationDumperPass; class TranslationDumperPassTest extends TestCase { public function testProcess() { $container = new ContainerBuilder(); $writerDefinition = $container->register('translation.writer'); $container->register('foo.id') ->addTag('translation.dumper', array('alias' => 'bar.alias')); $translationDumperPass = new TranslationDumperPass(); $translationDumperPass->process($container); $this->assertEquals(array(array('addDumper', array('bar.alias', new Reference('foo.id')))), $writerDefinition->getMethodCalls()); } public function testProcessNoDefinitionFound() { $container = new ContainerBuilder(); $definitionsBefore = count($container->getDefinitions()); $aliasesBefore = count($container->getAliases()); $translationDumperPass = new TranslationDumperPass(); $translationDumperPass->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:----Ww1yNXzNP0XYjRsYcZhWiLkGjlGwLHbPfnRO88luDMRXG9O6oAL8cVb+IHRe376bBmU8qiI65qJHOPDL1d/zf2FhlXinHAcaORF682lC/OKHghOiBftrE9M5tgm6Md23tFsP1I2Y7uF8SMOkJ5+OItQ9PvunXEZxoRM2LhevVjQzMoMQBfuiJF51hM+19XB6jHOGxAhx49p4sS6sRdt8/ttWjhH8StJtTh81oOMMvPwUTsI+nZwkXjwI+f1wd6qve6886nDbbIthvJypRoIKlBCZ0zcjpZoF4Qvo2rMtxfUBYHxazRU93XZGLojuZ+iKks/Pz9BsljeDCc6BfPCw+g2ty80hwn7Dee8Aww94EPM/B9iymHkDXcattiyupHAzjHgWbGRYRpBlUmrxqaa0jpCLXYsFHACP/UHvOs8zvd21YwEJGX2q53g/LEIoRgwDbWuVhw88Lwutq1sLSMdliUVXTJVo02wiqbp3y5ed4qknYgfW3sziLtLSWCXphD+qELtOBwF2rIKKSxmKv2o8qClm9NDU5auOoQcpAEQn/wg3Jg1JU/3autz+1vCm6EnayHYustS/jd3sEiMfOlBA936IzQsGPBvbMjk25XJIwDweuq08PbKo0zKgEe/PACVRzZ0nzG7nho2WhnrvHBsUPzPRUh08ffw5Jo1l+ALLcv0=----ATTACHMENT:----NDQyNDUzMjAyMjEyMTQ1OSAxMDgyNzI5NTYzMTU4MDMgOTc5MjI3OTM2MzYzMTU3NA==