Codeception / Codeception/module-laminas

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

Offen
#27 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
PHP
Sterne
1
Forks
7
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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!

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.