Codeception / Codeception/module-laminas

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

未关闭
#27 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
PHP
星标
1
派生
7
PR 合并指标
30 天内没有已合并 PR

描述

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!

贡献指南

这个仓库没有索引到贡献指南

调研方向

从 src/Codeception/Lib/Connector/Laminas.php 大约第 103-106 行开始,重现 issue 中描述的 GET 请求。跟踪为什么在 action 生成 JSON 400 响应后,MvcEvent 异常会被重新抛出,然后确定预期行为,并通过一个针对性的 Codeception 测试进行验证。

由索引模型根据 Issue 内容生成。

评估

技术栈
php
领域
testing
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
需要澄清
新手友好度
25/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。