Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Support for IN operator in Db Module

未关闭
#17 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
38/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
停滞
技术栈
php
领域
database, testing

调研方向

从 Db 模块中的 $I->dontSeeInDatabase 入口点开始,跟踪数组条件如何转换为查询。复现报告中的数组值案例,然后添加对所请求 IN 行为的支持,并验证生成的断言将匹配的行视为不存在。

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

描述

What are you trying to achieve?

I wanted to check that $I->dontSeeInDatabase from a list of values. Instead of writing

$I->dontSeeInDatabase('someTable', ['foo' => 'cond1']);
$I->dontSeeInDatabase('someTable', ['foo' => 'cond2']);
$I->dontSeeInDatabase('someTable', ['foo' => 'cond3']);

I ended up writing

$I->dontSeeInDatabase('someTable', [
    'foo' => ['cond1', 'cond2', 'cond3']
]);

hoping that it would generate the following query SELECT count(*) FROM someTable WHERE foo IN ('cond1', 'cond2', 'cond3') and assert that the result must be 0. However I ended up getting an exception, saying array-to-string conversion - obviously enough since this is not supported.

Do you think this is something good to have, or just bad test design on my part?

  • Codeception version: 2.3.3
主要语言
PHP
星标
23
派生
31
PR 合并指标
30 天内没有已合并 PR

贡献指南

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

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

Codeception/module-db 的其他 Issue

查看 Codeception/module-db 的全部 Issue

相似的 Issue

更多 PHP Issue

把新 issue 发到你的邮箱

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