Codeception / Codeception/module-laminas

Codeception re-throws exception from MvcEvent occurred in Laminas-request

Open
#27 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
1
Forks
7
PR merge metrics
No merged PRs in 30d

Description

Hello, i have scenario:
1. test makes GET-request
```
public function userTriesToGetTestInfo( ApiTester $i ): void
{
$i->sendGet( 'http://example.com/test' );
}
```
2. `testAction` throws `Exception`, logic catches it and generates correct JSON-response with 400 http code.
3. Codeception in sources re-throws Exception from MvcEvent:
https://github.com/Codeception/module-laminas/blob/00d6cf8ae6a10ef52b3569febf1d6277d7b3b8e1/src/Codeception/Lib/Connector/Laminas.php#L103-L106

questions:
1. what is the purpose of this behavior?
2. how to prevent such re-throws and gracefully receive JSON-response to make needed assertion in test-code?

thanks!

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at src/Codeception/Lib/Connector/Laminas.php around lines 103-106 and reproduce the GET request described in the issue. Trace why the MvcEvent exception is re-thrown after the action produces a JSON 400 response, then establish the expected behavior and verify it with a focused Codeception test.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.