Update test

If the database isn't found when checking for the connection it means, we can connect to the server.
The InstallCommand will create the database later.

Also, when checking for the SQLite connection, Doctrine creates the file (so the database). That's why the test is skipped for SQLite.
This commit is contained in:
Jeremy Benoist
2016-09-03 10:34:27 +02:00
parent 001a7bad66
commit f62c3faf88
2 changed files with 12 additions and 4 deletions

View File

@ -127,6 +127,12 @@ class InstallCommandTest extends WallabagCoreTestCase
public function testRunInstallCommandWithDatabaseRemoved()
{
// skipped SQLite check when database is removed because while testing for the connection,
// the driver will create the file (so the database) before testing if database exist
if ($this->getClient()->getContainer()->get('doctrine')->getConnection()->getDriver() instanceof \Doctrine\DBAL\Driver\PDOSqlite\Driver) {
$this->markTestSkipped('SQLite spotted: can\'t test with database removed.');
}
$application = new Application($this->getClient()->getKernel());
$application->add(new DropDatabaseDoctrineCommand());