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

[yii2] unloading fixtures only if `cleanup` configuration equals true. #4207

Closed
Faryshta opened this Issue May 10, 2017 · 1 comment

Comments

Projects
None yet
2 participants
@Faryshta
Contributor

Faryshta commented May 10, 2017

What are you trying to achieve?

after setting up cleanup: false configuration for the yii2 module still unloads fixtures and that might cascade on other operations

$I->haveFixtures(['store' => StoreFixture::class]);
$model = new Sale(['store_id' => 1]);
$this->assertTrue($model->save());

I expect that sale to be available after the test ends to be handled on other tests.

What do you get instead?

The fixtures always unload after every test so it means any foreign key will either cascade the delete to the store record or throw a db exception.

$fixture->unloadFixtures(); must only be called if $this->config['cleanup'] equals true.

@samdark samdark added the Yii label May 10, 2017

@samdark

This comment has been minimized.

Show comment
Hide comment
@samdark

samdark May 10, 2017

Collaborator

@Faryshta how about a pull request?

Collaborator

samdark commented May 10, 2017

@Faryshta how about a pull request?

@DavertMik DavertMik closed this in fd05434 May 11, 2017

chris1312 added a commit to chris1312/Codeception that referenced this issue Jun 16, 2017

fix #4207 unload fixtures when `cleanup == true` (#4208)
* fix #4207 unload fixtures when `cleanup == true`

* typo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment