Codeception / Codeception/module-db

Support for IN operator in Db Module

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

描述

#### What are you trying to achieve?
I wanted to check that `$I->dontSeeInDatabase` from a list of values. Instead of writing
```php
$I->dontSeeInDatabase('someTable', ['foo' => 'cond1']);
$I->dontSeeInDatabase('someTable', ['foo' => 'cond2']);
$I->dontSeeInDatabase('someTable', ['foo' => 'cond3']);
```
I ended up writing
```php
$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

贡献指南

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

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

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