File tree Expand file tree Collapse file tree 2 files changed +29
-1
lines changed Expand file tree Collapse file tree 2 files changed +29
-1
lines changed Original file line number Diff line number Diff line change @@ -51,12 +51,12 @@ public function __construct()
51
51
$ this ->optimizationPasses = array (array (
52
52
new ResolveChildDefinitionsPass (),
53
53
new ServiceLocatorTagPass (),
54
+ new RegisterServiceSubscribersPass (),
54
55
new DecoratorServicePass (),
55
56
new ResolveParameterPlaceHoldersPass (false ),
56
57
new ResolveFactoryClassPass (),
57
58
new FactoryReturnTypePass ($ resolveClassPass ),
58
59
new CheckDefinitionValidityPass (),
59
- new RegisterServiceSubscribersPass (),
60
60
new ResolveNamedArgumentsPass (),
61
61
new AutowireRequiredMethodsPass (),
62
62
new ResolveBindingsPass (),
Original file line number Diff line number Diff line change 17
17
use Symfony \Component \DependencyInjection \ContainerBuilder ;
18
18
use Symfony \Component \DependencyInjection \Loader \YamlFileLoader ;
19
19
use Symfony \Component \DependencyInjection \Reference ;
20
+ use Symfony \Component \DependencyInjection \ServiceSubscriberInterface ;
20
21
21
22
/**
22
23
* This class tests the integration of the different compiler passes.
@@ -117,6 +118,21 @@ public function testProcessInlinesWhenThereAreMultipleReferencesButFromTheSameDe
117
118
$ this ->assertFalse ($ container ->hasDefinition ('c ' ), 'Service C was not inlined. ' );
118
119
}
119
120
121
+ public function testCanDecorateServiceSubscriber ()
122
+ {
123
+ $ container = new ContainerBuilder ();
124
+ $ container ->register (ServiceSubscriberStub::class)
125
+ ->addTag ('container.service_subscriber ' )
126
+ ->setPublic (true );
127
+
128
+ $ container ->register (DecoratedServiceSubscriber::class)
129
+ ->setDecoratedService (ServiceSubscriberStub::class);
130
+
131
+ $ container ->compile ();
132
+
133
+ $ this ->assertInstanceOf (DecoratedServiceSubscriber::class, $ container ->get (ServiceSubscriberStub::class));
134
+ }
135
+
120
136
/**
121
137
* @dataProvider getYamlCompileTests
122
138
*/
@@ -207,6 +223,18 @@ public function getYamlCompileTests()
207
223
}
208
224
}
209
225
226
+ class ServiceSubscriberStub implements ServiceSubscriberInterface
227
+ {
228
+ public static function getSubscribedServices ()
229
+ {
230
+ return array ();
231
+ }
232
+ }
233
+
234
+ class DecoratedServiceSubscriber
235
+ {
236
+ }
237
+
210
238
class IntegrationTestStub extends IntegrationTestStubParent
211
239
{
212
240
}
You can’t perform that action at this time.
0 commit comments