Codeception / Codeception/module-db

Support for IN operator in Db Module

Aperta
#17 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
PHP
Stelle
23
Fork
31
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

#### 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

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.