File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed
src/Symfony/Component/EventDispatcher Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ public function getArgument($key)
7171 return $ this ->arguments [$ key ];
7272 }
7373
74- throw new \InvalidArgumentException (sprintf ('%s not found in %s ' , $ key, $ this -> getName () ));
74+ throw new \InvalidArgumentException (sprintf ('Argument "%s" not found. ' , $ key ));
7575 }
7676
7777 /**
Original file line number Diff line number Diff line change @@ -118,10 +118,18 @@ public function testDispatch()
118118 $ this ->assertInstanceOf ('Symfony\Component\EventDispatcher\Event ' , $ this ->dispatcher ->dispatch (self ::preFoo));
119119 $ event = new Event ();
120120 $ return = $ this ->dispatcher ->dispatch (self ::preFoo, $ event );
121- $ this ->assertEquals ('pre.foo ' , $ event ->getName ());
122121 $ this ->assertSame ($ event , $ return );
123122 }
124123
124+ public function testLegacyDispatch ()
125+ {
126+ $ this ->iniSet ('error_reporting ' , -1 & ~E_USER_DEPRECATED );
127+
128+ $ event = new Event ();
129+ $ return = $ this ->dispatcher ->dispatch (self ::preFoo, $ event );
130+ $ this ->assertEquals ('pre.foo ' , $ event ->getName ());
131+ }
132+
125133 public function testDispatchForClosure ()
126134 {
127135 $ invoked = 0 ;
@@ -239,8 +247,10 @@ public function testRemoveSubscriberWithMultipleListeners()
239247 $ this ->assertFalse ($ this ->dispatcher ->hasListeners (self ::preFoo));
240248 }
241249
242- public function testEventReceivesTheDispatcherInstance ()
250+ public function testLegacyEventReceivesTheDispatcherInstance ()
243251 {
252+ $ this ->iniSet ('error_reporting ' , -1 & ~E_USER_DEPRECATED );
253+
244254 $ dispatcher = null ;
245255 $ this ->dispatcher ->addListener ('test ' , function ($ event ) use (&$ dispatcher ) {
246256 $ dispatcher = $ event ->getDispatcher ();
You can’t perform that action at this time.
0 commit comments