From 5f9e1779960c1037f80340143e75af68e41a8521 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Haso=C5=88?= Date: Thu, 17 Mar 2016 11:56:43 +0100 Subject: [PATCH] [DependencyInjection] Added a failing test for autowiring --- .../Tests/Compiler/AutowirePassTest.php | 2 +- .../Tests/Compiler/OptionalServiceClass.php | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 src/Symfony/Component/DependencyInjection/Tests/Compiler/OptionalServiceClass.php diff --git a/src/Symfony/Component/DependencyInjection/Tests/Compiler/AutowirePassTest.php b/src/Symfony/Component/DependencyInjection/Tests/Compiler/AutowirePassTest.php index d9424547309a7..4efd9134dc819 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Compiler/AutowirePassTest.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Compiler/AutowirePassTest.php @@ -402,7 +402,7 @@ public function testIgnoreServiceWithClassNotExisting() { $container = new ContainerBuilder(); - $container->register('class_not_exist', 'Class\Not\Exist'); + $container->register('class_not_exist', __NAMESPACE__.'\OptionalServiceClass'); $barDefinition = $container->register('bar', __NAMESPACE__.'\Bar'); $barDefinition->setAutowired(true); diff --git a/src/Symfony/Component/DependencyInjection/Tests/Compiler/OptionalServiceClass.php b/src/Symfony/Component/DependencyInjection/Tests/Compiler/OptionalServiceClass.php new file mode 100644 index 0000000000000..7e9238f22301b --- /dev/null +++ b/src/Symfony/Component/DependencyInjection/Tests/Compiler/OptionalServiceClass.php @@ -0,0 +1,18 @@ + + * + * 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 Symfony\Bug\NotExistClass; + +class OptionalServiceClass extends NotExistClass +{ +}