Warm tip: This article is reproduced from stackoverflow.com, please click
codeception

Codeception. Insert multiple records

发布于 2020-05-13 23:34:15

Is it possible to insert several records to the DB in Codeception? This code doesn't work but maybe there is another option.

$this->tester->haveRecord('vacations',
            ['destination' => $this->"Place 1"],
            ['destination' => $this->"Place 2"]);
Questioner
Svetoslav Dimitrov
Viewed
28
Svetoslav Dimitrov 2020-02-29 04:45

Splitting it into two worked perfectly.

$this->tester->haveRecord('vacations',
            ['destination' => $this->"Place 1"]);
$this->tester->haveRecord('vacations',
            ['destination' => $this->"Place 2"]);