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

Changed the way sqlite is managing the files #2812

merged 1 commit into from Feb 28, 2016


None yet
2 participants

mcustiel commented Feb 18, 2016

I started to have some problems while using sqlite to run tests.

Originally Sqlite constructor did the following:

        parent::__construct($dsn, $user, $password);
        $this->filename = Configuration::projectDir() . substr($this->dsn, 7);
        $this->dsn = 'sqlite:' . $this->filename;

The call to parent::__construct creates a connection using the dsn from the parameter, then the filename and dsn are modified prepending the projectDir.
This fails, caused a problem while running my tests because if the connection was successful, then the load failed because the path had been changed, and if I changed the path in the dsn to match the one in load, then the connection failed.
I think it is better to first prepend the projectDir and then call parent, so connection and load use the same path.

        $this->filename = Configuration::projectDir() . substr($dsn, 7);
        $this->dsn = 'sqlite:' . $this->filename;
        parent::__construct($this->dsn, $user, $password);

Still, this won't work with absolute paths. But I am not sure if that was planned by design.

Naktibalda added a commit that referenced this pull request Feb 28, 2016

Merge pull request #2812 from mcustiel/fix-sqlite
Changed the way sqlite is managing the files

@Naktibalda Naktibalda merged commit d15ab59 into Codeception:2.1 Feb 28, 2016

1 check passed

continuous-integration/appveyor/pr AppVeyor build succeeded

This comment has been minimized.

Show comment
Hide comment

Naktibalda Feb 28, 2016


Thank you


Naktibalda commented Feb 28, 2016

Thank you

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