66use Enqueue \Bundle \Events \ProxyEventDispatcher ;
77use Enqueue \Test \ClassExtensionTrait ;
88use PHPUnit \Framework \TestCase ;
9- use Symfony \Component \DependencyInjection \Container ;
10- use Symfony \Component \EventDispatcher \ContainerAwareEventDispatcher ;
119use Symfony \Component \EventDispatcher \EventDispatcher ;
1210use Symfony \Component \EventDispatcher \GenericEvent ;
1311
1412class ProxyEventDispatcherTest extends TestCase
1513{
1614 use ClassExtensionTrait;
1715
18- public function testShouldBeSubClassOfContainerAwareEventDispatcher ()
16+ public function testShouldBeSubClassOfEventDispatcher ()
1917 {
20- $ this ->assertClassExtends (ContainerAwareEventDispatcher ::class, ProxyEventDispatcher::class);
18+ $ this ->assertClassExtends (EventDispatcher ::class, ProxyEventDispatcher::class);
2119 }
2220
2321 public function testShouldSetSyncModeForGivenEventNameOnDispatchAsyncListenersOnly ()
@@ -34,7 +32,7 @@ public function testShouldSetSyncModeForGivenEventNameOnDispatchAsyncListenersOn
3432 ;
3533
3634 $ trueEventDispatcher = new EventDispatcher ();
37- $ dispatcher = new ProxyEventDispatcher (new Container (), $ trueEventDispatcher , $ asyncListenerMock );
35+ $ dispatcher = new ProxyEventDispatcher ($ trueEventDispatcher , $ asyncListenerMock );
3836
3937 $ event = new GenericEvent ();
4038 $ dispatcher ->dispatchAsyncListenersOnly ('theEvent ' , $ event );
@@ -51,7 +49,7 @@ public function testShouldCallAsyncEventButNotOtherOnDispatchAsyncListenersOnly(
5149 });
5250
5351 $ asyncEventWasCalled = false ;
54- $ dispatcher = new ProxyEventDispatcher (new Container (), $ trueEventDispatcher , $ this ->createAsyncLisenerMock ());
52+ $ dispatcher = new ProxyEventDispatcher ($ trueEventDispatcher , $ this ->createAsyncLisenerMock ());
5553 $ dispatcher ->addListener ('theEvent ' , function () use (&$ asyncEventWasCalled ) {
5654 $ this ->assertInstanceOf (ProxyEventDispatcher::class, func_get_arg (2 ));
5755
@@ -76,7 +74,7 @@ public function testShouldCallOtherEventIfDispatchedFromAsyncEventOnDispatchAsyn
7674 });
7775
7876 $ asyncEventWasCalled = false ;
79- $ dispatcher = new ProxyEventDispatcher (new Container (), $ trueEventDispatcher , $ this ->createAsyncLisenerMock ());
77+ $ dispatcher = new ProxyEventDispatcher ($ trueEventDispatcher , $ this ->createAsyncLisenerMock ());
8078 $ dispatcher ->addListener ('theEvent ' , function () use (&$ asyncEventWasCalled ) {
8179 $ this ->assertInstanceOf (ProxyEventDispatcher::class, func_get_arg (2 ));
8280
@@ -99,7 +97,7 @@ public function testShouldNotCallAsyncEventIfDispatchedFromOtherEventOnDispatchA
9997 func_get_arg (2 )->dispatch ('theOtherAsyncEvent ' );
10098 });
10199
102- $ dispatcher = new ProxyEventDispatcher (new Container (), $ trueEventDispatcher , $ this ->createAsyncLisenerMock ());
100+ $ dispatcher = new ProxyEventDispatcher ($ trueEventDispatcher , $ this ->createAsyncLisenerMock ());
103101 $ dispatcher ->addListener ('theAsyncEvent ' , function () {
104102 func_get_arg (2 )->dispatch ('theOtherEvent ' );
105103 });
0 commit comments