File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
src/Symfony/Component/DependencyInjection/Tests Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -538,6 +538,16 @@ public function testReplacingAPreDefinedServiceIsDeprecated()
538
538
539
539
$ this ->assertSame ($ bar , $ c ->get ('bar ' ), '->set() replaces a pre-defined service ' );
540
540
}
541
+
542
+ /**
543
+ * @group legacy
544
+ * @expectedDeprecation The "synthetic" service is private, replacing it is deprecated since Symfony 3.2 and will fail in 4.0.
545
+ */
546
+ public function testSetWithPrivateSyntheticServiceThrowsDeprecation ()
547
+ {
548
+ $ c = new ProjectServiceContainer ();
549
+ $ c ->set ('synthetic ' , new \stdClass ());
550
+ }
541
551
}
542
552
543
553
class ProjectServiceContainer extends Container
@@ -565,8 +575,12 @@ public function __construct()
565
575
$ this ->__foo_bar = new \stdClass ();
566
576
$ this ->__foo_baz = new \stdClass ();
567
577
$ this ->__internal = new \stdClass ();
568
- $ this ->privates = array ('internal ' => true );
578
+ $ this ->privates = array (
579
+ 'internal ' => true ,
580
+ 'synthetic ' => true ,
581
+ );
569
582
$ this ->aliases = array ('alias ' => 'bar ' );
583
+ $ this ->syntheticIds ['synthetic ' ] = true ;
570
584
}
571
585
572
586
protected function getInternalService ()
You can’t perform that action at this time.
0 commit comments