File tree Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -397,6 +397,21 @@ public function testOptionalScalarArgsNotPassedIfLast()
397
397
$ definition ->getArguments ()
398
398
);
399
399
}
400
+
401
+ public function testIgnoreServiceWithClassNotExisting ()
402
+ {
403
+ $ container = new ContainerBuilder ();
404
+
405
+ $ container ->register ('class_not_exist ' , __NAMESPACE__ .'\OptionalServiceClass ' );
406
+
407
+ $ barDefinition = $ container ->register ('bar ' , __NAMESPACE__ .'\Bar ' );
408
+ $ barDefinition ->setAutowired (true );
409
+
410
+ $ pass = new AutowirePass ();
411
+ $ pass ->process ($ container );
412
+
413
+ $ this ->assertTrue ($ container ->hasDefinition ('bar ' ));
414
+ }
400
415
}
401
416
402
417
class Foo
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ /*
4
+ * This file is part of the Symfony package.
5
+ *
6
+ * (c) Fabien Potencier <fabien@symfony.com>
7
+ *
8
+ * For the full copyright and license information, please view the LICENSE
9
+ * file that was distributed with this source code.
10
+ */
11
+
12
+ namespace Symfony \Component \DependencyInjection \Tests \Compiler ;
13
+
14
+ use Symfony \Bug \NotExistClass ;
15
+
16
+ class OptionalServiceClass extends NotExistClass
17
+ {
18
+ }
You can’t perform that action at this time.
0 commit comments