When I use the Security component in Cake3 I always get the error message: "The request has been black-holed" in my controller tests. It works as expected because the request is really black-holed in that case but I need a possibility to test my code anyway.
I found the following post about the same issue but in Cake2. Unfortunately I was not able to transfer it to Cake3 and maybe it's not possible to use the same approach here.
This is how my test case looks:
$data = [
'first_name' => 'Test First Name',
'last_name' => 'Test Last Name',
'gender' => Gender::MALE,
'role_id' => Role::ADMIN,
'email' => 'test@test.com',
'password' => '',
'status' => Status::ACTIVE,
'birthday' => '2015-01-01',
];
$this->post(['prefix' => 'admin', 'controller' => 'users', 'action' => 'edit', 1], $data);
Same problem occurs also for Csrf component but the solution should be quite similar so I will figure this out afterwards.