Skip to content

Commit 6ae89db

Browse files
devonliu02DavertMik
authored andcommitted
unloadFixtures() should run after db transaction (#4497)
1 parent ce3b656 commit 6ae89db

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/Codeception/Module/Yii2.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -223,17 +223,17 @@ public function _after(TestInterface $test)
223223
$_COOKIE = [];
224224
$_REQUEST = [];
225225

226+
if ($this->config['transaction'] && $this->transaction) {
227+
$this->transaction->rollBack();
228+
$this->debugSection('Database', 'Transaction cancelled; all changes reverted.');
229+
}
230+
226231
if ($this->config['cleanup']) {
227232
foreach ($this->loadedFixtures as $fixture) {
228233
$fixture->unloadFixtures();
229234
}
230235
$this->loadedFixtures = [];
231236
}
232-
233-
if ($this->config['transaction'] && $this->transaction) {
234-
$this->transaction->rollBack();
235-
$this->debugSection('Database', 'Transaction cancelled; all changes reverted.');
236-
}
237237

238238
if ($this->client) {
239239
$this->client->resetPersistentVars();

0 commit comments

Comments
 (0)