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

貢獻指南

這個儲存庫沒有索引到貢獻指南

研究方向

從 Db 模組中的 $I->dontSeeInDatabase 進入點開始,追蹤陣列條件如何轉換成查詢。重現回報的陣列值案例,接著加入對所要求 IN 行為的支援,並驗證產生的 assertion 將符合的資料列視為不存在。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
php
領域
database, testing
Issue 類型
功能
難度
3/5
預估耗時
1-2 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
38/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。