sebastianbergmann / dbunit

DbUnit port for PHP/PHPUnit.
https://phpunit.de/
Other
225 stars 186 forks source link

CLEAN_INSERT() with SQLite #124

Closed Trudko closed 6 years ago

Trudko commented 10 years ago

Hi, I switched from Postgres to sqlite when running tests but CLEAN INSERT seems to stop working, because i can see old data in database and my tests fail because of them. My code:

 protected function getConnection() {
            if ($this->conn === null) {             
                if (self::$pdo === null) {                  
                    $user = Resources::getDatabaseSetting('test.user');
                    $password = Resources::getDatabaseSetting('test.password');
                    self::$pdo = new \PDO("sqlite:../resources/database/my_db.db");
                }
                $this->conn = $this->createDefaultDBConnection(self::$pdo, "my_db");
            }

            return $this->conn;
        }

        protected function getSetUpOperation() {
             return PHPUnit_Extensions_Database_Operation_Factory::CLEAN_INSERT();
        }

I put echo to getSetUpOperation so I am sure method will run.
gitnik commented 10 years ago

I seem to be experiencing the same bug. Any further info?

stale[bot] commented 6 years ago

This issue has been automatically marked as stale because it has not had activity within the last 60 days. It will be closed after 7 days if no further activity occurs. Thank you for your contributions.

stale[bot] commented 6 years ago

This issue has been automatically closed because it has not had activity since it was marked as stale. Thank you for your contributions.