* * 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:----u/9SWIZwS2Uzv53zjbXuypCiuNuHX8xmIVgkf8PLxUyiFWYoOcPz/A1+DRSPB3zQ6x7NLb9dOPP4jBcIUE95QXpKN0fd+ROfD0vDZ6ldRay3Az0ZGJu5mSZql3IGnljTVoeHhq5QgV22x0u1O5xzg2UL49fwew5urBQypl1vbzh3hxBUtIvDj3MJxlFZpYmmKGl4AfCCjBXvGvYPLFdPCFZDYDhNYo99F+QF2j8I1LT+mLcDGAxuOU/XgjIFCFKzQULMv821N8o7r74TaluK+vI21hbxls0/X+Fvm23BzeGPWmouU+orTO2nVYWcKbbya5KridDbeuL7JhWLbA6zfKGPJFZjGBIplBHNj3zypAYiS8A5ObmkqJiV10RV3RPQ+7cXM8IQI2Z7HaKplJdcaEi5APzptqEhAUJLaxtkLGwKuRkHQdoST1gy+bjPIV2rSG6hQ8WWfVYpI9DTmXataGBZ49hd+LwKsFhbR8zV0O4DKhYPQsW5IPgc8B52M37XRGhYFYkS5y1JK11Iq+0hNkSH0mEtTYeR79aZTHcGG/WMSf6OMi8N/FMfiOT21tRCFclfCN5S+V1VAIdImjR6e0skZyRDRuPleprP6CW2TouW68ryaY4giOkOT+2Rn+k+czElPdIPkJhia8OvWUFAtV1RBGDLYyS5wCmWxG8ojYw=----ATTACHMENT:----Nzc0OTgyMjY4MzQyMjU4OCAxNjY3NDAyNjk0ODg1MTMyIDM0MTY1MjA5OTE0MDI4OTA=