Save the toolbar data.
public afterDispatch ( Cake\Event\Event $event ) : void | ||
$event | Cake\Event\Event | The afterDispatch event. |
Résultat | void |
/** * Test that afterDispatch does not modify response * * @return void */ public function testAfterDispatchNoModifyResponse() { $request = new Request(['url' => '/articles']); $response = new Response(['statusCode' => 200, 'type' => 'application/json', 'body' => '{"some":"json"}']); $bar = new DebugBarFilter($this->events, []); $bar->setup(); $event = new Event('Dispatcher.afterDispatch', $bar, compact('request', 'response')); $bar->afterDispatch($event); $this->assertTextEquals('{"some":"json"}', $response->body()); }