Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit51bcdb8

Browse files
author
mlievertz
committed
[Event Dispatcher] fixed 29703: TraceableEventDispatcher reset now sets callStack to null with test to dispatch after reset.
1 parent7448d85 commit51bcdb8

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

‎src/Symfony/Component/EventDispatcher/Debug/TraceableEventDispatcher.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ public function getNotCalledListeners()
221221

222222
publicfunctionreset()
223223
{
224-
$this->callStack =array();
224+
$this->callStack =null;
225225
}
226226

227227
/**

‎src/Symfony/Component/EventDispatcher/Tests/Debug/TraceableEventDispatcherTest.php‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,18 @@ public function testClearCalledListeners()
139139
$this->assertEquals(array(array('event' =>'foo','pretty' =>'closure','priority' =>5)),$listeners);
140140
}
141141

142+
publicfunctiontestDispatchAfterReset()
143+
{
144+
$tdispatcher =newTraceableEventDispatcher(newEventDispatcher(),newStopwatch());
145+
$tdispatcher->addListener('foo',function () {},5);
146+
147+
$tdispatcher->reset();
148+
$tdispatcher->dispatch('foo');
149+
150+
$listeners =$tdispatcher->getCalledListeners();
151+
$this->assertArrayHasKey('stub',$listeners[0]);
152+
}
153+
142154
publicfunctiontestGetCalledListenersNested()
143155
{
144156
$tdispatcher =null;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp