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

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

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

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

Faryshta opened this issue May 10, 2017 · 1 comment
Labels
Yii

Comments

@Faryshta
Copy link
Contributor

@Faryshta 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
Copy link
Collaborator

@samdark samdark commented May 10, 2017

@Faryshta how about a pull request?

@DavertMik DavertMik closed this in fd05434 May 11, 2017
chris1312 pushed a commit to chris1312/Codeception that referenced this issue Jun 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.