Skip to content

Commit 55be2ea

Browse files
committed
Event fake is broken when inspecting multiple events of same type.
1 parent 819888c commit 55be2ea

1 file changed

Lines changed: 0 additions & 20 deletions

File tree

src/Illuminate/Support/Testing/Fakes/EventFake.php

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,6 @@ public function dispatched($event, $callback = null)
6363

6464
return collect($this->events[$event])->filter(function ($arguments) use ($callback) {
6565
return $callback(...$arguments);
66-
})->flatMap(function ($arguments) {
67-
return $this->mapEventArguments($arguments);
6866
});
6967
}
7068

@@ -79,24 +77,6 @@ public function hasDispatched($event)
7977
return isset($this->events[$event]) && ! empty($this->events[$event]);
8078
}
8179

82-
/**
83-
* Map the "fire" method arguments for inspection.
84-
*
85-
* @param array $arguments
86-
* @return array
87-
*/
88-
protected function mapEventArguments($arguments)
89-
{
90-
// If the fired event was just a simple string event, we will return the event
91-
// name as the key with the array of arguments as the value. Otherwise this
92-
// event was an object event and we will return this object as the value.
93-
if (is_string($arguments[0])) {
94-
return [$arguments[0] => $arguments[1]];
95-
} else {
96-
return [get_class($arguments[0]) => $arguments[0]];
97-
}
98-
}
99-
10080
/**
10181
* Register an event listener with the dispatcher.
10282
*

0 commit comments

Comments
 (0)