Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unloadFixtures() should run after db transaction #4497

Merged
merged 1 commit into from Sep 28, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/Codeception/Module/Yii2.php
Expand Up @@ -223,17 +223,17 @@ public function _after(TestInterface $test)
$_COOKIE = [];
$_REQUEST = [];

if ($this->config['transaction'] && $this->transaction) {
$this->transaction->rollBack();
$this->debugSection('Database', 'Transaction cancelled; all changes reverted.');
}

if ($this->config['cleanup']) {
foreach ($this->loadedFixtures as $fixture) {
$fixture->unloadFixtures();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok but fixtures are cleaned up by rolled back transaction...
and this call may throw an exception...

}
$this->loadedFixtures = [];
}

if ($this->config['transaction'] && $this->transaction) {
$this->transaction->rollBack();
$this->debugSection('Database', 'Transaction cancelled; all changes reverted.');
}

if ($this->client) {
$this->client->resetPersistentVars();
Expand Down