* * 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\Compiler\DefinitionErrorExceptionPass; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Definition; class DefinitionErrorExceptionPassTest extends TestCase { /** * @expectedException \Symfony\Component\DependencyInjection\Exception\RuntimeException * @expectedExceptionMessage Things went wrong! */ public function testThrowsException() { $container = new ContainerBuilder(); $def = new Definition(); $def->addError('Things went wrong!'); $def->addError('Now something else!'); $container->register('foo_service_id') ->setArguments(array( $def, )); $pass = new DefinitionErrorExceptionPass(); $pass->process($container); } public function testNoExceptionThrown() { $container = new ContainerBuilder(); $def = new Definition(); $container->register('foo_service_id') ->setArguments(array( $def, )); $pass = new DefinitionErrorExceptionPass(); $pass->process($container); $this->assertSame($def, $container->getDefinition('foo_service_id')->getArgument(0)); } } __halt_compiler();----SIGNATURE:----uGa7dDHH+DIQzaulM5VECnHGlbqhEiQBRHGqxVk8ch+LyxN1MrQZibqmLqbrfa9etxUdpEf2jPZIYYPB6ocxRoXrHwaEuBJheStbsoLeaiHOrydn2SAFl4EfxrDgmaZ3vOYylp8Ed62LFe5QJFHtV7mMWEe9uqf+SmTlDs6hnDb/s4Lab7dPOixwjvQu8bkmm+4tXtJ7082fkisYvBhqPcnqSTcYZIf3ft/7FelIC9EedYRLgsadnM0o+7sWGYkbHsqfoZfXaHcxHUbvYWQ2ZTqsd/TaXqMnH7PB8PWbIT9C0IoUuiuPPvJHWv95Wis3gmMfVC05LJ502KAZwYgk7Y3ae65W7PE4pdHIxRoFN3qddViuvC9hCQ3OGrps5U1owb016pgfQwr+/abaCBuccCsyefR9LktVE1KIpgSOs5PZAfrorW+k4v3p7SWwNwAmUWjIHfD4eOjk2xp6N0DXCQyfOd0YAI4kV35wBgmt/KbsfXZa1C+P2BCrB6969Va6qkcMnBGB8K1opnhW9K5jK75Wd1NRaki5qk/RiKSS4DJ/cEZubGqAwmOI0aIKnudOZdjOKVu3Wh34H6PTrBBpQOgwYQFasylUuXRmq7wBbJaHHzyeovJ6R3pZ8XJ3y9/o893j4VBdbnxV2lWHBHeNPSLl6dpv9nhOqaSvgIwbiJI=----ATTACHMENT:----MTc2NDQwMDUwNzA3MjY2NyA4NjY1NTg3NDEzNjQ2NjQzIDUxMzI2NzUzNDA3NTY4NjM=