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

ResetDatabase doesn't work with sqlite DB #46

Closed
anjeylink opened this issue Oct 8, 2020 · 6 comments
Closed

ResetDatabase doesn't work with sqlite DB #46

anjeylink opened this issue Oct 8, 2020 · 6 comments

Comments

@anjeylink
Copy link

Error occurs when run tests using ResetDatabase trait together with sqlite

Error running "doctrine:database:drop": 
In DBALException.php line 39:
Operation 'Doctrine\DBAL\Platforms\AbstractPlatform::getListDatabasesSQL' is not supported by platform. 

Looks like it's dbal issue.

In \Zenstruck\Foundry\Test\DatabaseResetter::runCommand I added check for sqllite, but I'm not sure if bundle should be responsible for checking this though.

if (isset($parameters['--if-exists'])
    && $application->getKernel()->getContainer()->get('doctrine')->getConnection()->getDatabasePlatform()->getName() === 'sqlite'
) {
    unset($parameters['--if-exists']);
}
@anjeylink
Copy link
Author

doctrine/dbal#2402

@kbond
Copy link
Member

kbond commented Oct 8, 2020

Thanks @anjeylink - I'll add this check and look into running the test suite against sqlite as well to see if there are any other issues.

kbond added a commit to kbond/foundry that referenced this issue Oct 8, 2020
kbond added a commit to kbond/foundry that referenced this issue Oct 8, 2020
kbond added a commit to kbond/foundry that referenced this issue Oct 8, 2020
@kbond kbond closed this as completed in d4e3a2e Oct 8, 2020
@kbond
Copy link
Member

kbond commented Oct 8, 2020

@anjeylink, I added a fix but discovered an edge case where the test suite fails when using the FoundryBundle and DAMADoctrineTestBundle together (#49). I need to investigate further.

If you aren't using DAMADoctrineTestBundle, sqlite should work as expected now.

@anjeylink
Copy link
Author

@kbond thx !

@anjeylink
Copy link
Author

anjeylink commented Oct 12, 2020

@kbond will be there a release for this fix soon?
by the way I'm using DAMADoctrineTestBundle and it's working fine.

@kbond
Copy link
Member

kbond commented Oct 12, 2020

Thanks for reminding me: v1.2.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants