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

Fails to connect into mysql database when database not created #4

Closed
alexislefebvre opened this issue May 30, 2019 · 0 comments · Fixed by #6
Closed

Fails to connect into mysql database when database not created #4

alexislefebvre opened this issue May 30, 2019 · 0 comments · Fixed by #6
Assignees

Comments

@alexislefebvre
Copy link
Collaborator

alexislefebvre commented May 30, 2019

Source: liip/LiipFunctionalTestBundle#470


Hello,

This library fails to connect into mysql database when database not created with error An exception occurred in driver: SQLSTATE[HY000] [1049] Unknown database 'test'

Place where error occurs:
https://github.com/liip/LiipFunctionalTestBundle/blob/2.0.0-alpha10/src/Services/DatabaseTools/ORMDatabaseTool.php#L63 or commit to be exact fails because used dbal library performs connect https://github.com/doctrine/dbal/blob/b45ed5e13e4834f64fbc56bfdc0344430cecae63/lib/Doctrine/DBAL/Connection.php#L358 into database despite unset($params['dbname']); in your class ORMDatabaseTool in 61 line

Steps to reproduce

class MyClassTest extends \Liip\FunctionalTestBundle\Test\WebTestCase
{
    protected function setUp(): void
    {
        self::bootKernel();
        $this->loadFixtures([
            LoadEntities::class,
        ]);
        parent::setUp();
    }
}

and

"doctrine/dbal": "^2.8",
"liip/functional-test-bundle": "~2.0@alpha",
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant