[2.0] Adjusted getConnection since there is no need to create/drop the database for sqlite in-memory.
This commit is contained in:
parent
c3f5cba785
commit
0b09e50148
@ -1,4 +1,4 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Doctrine\Tests;
|
namespace Doctrine\Tests;
|
||||||
|
|
||||||
@ -16,19 +16,18 @@ class TestUtil
|
|||||||
'dbname' => $GLOBALS['db_name'],
|
'dbname' => $GLOBALS['db_name'],
|
||||||
'port' => $GLOBALS['db_port']
|
'port' => $GLOBALS['db_port']
|
||||||
);
|
);
|
||||||
|
$conn = \Doctrine\DBAL\DriverManager::getConnection($params);
|
||||||
|
$conn->getSchemaManager()->dropAndCreateDatabase();
|
||||||
|
$conn->close();
|
||||||
|
$conn->connect();
|
||||||
} else {
|
} else {
|
||||||
$params = array(
|
$params = array(
|
||||||
'driver' => 'pdo_sqlite',
|
'driver' => 'pdo_sqlite',
|
||||||
'memory' => true
|
'memory' => true
|
||||||
);
|
);
|
||||||
|
$conn = \Doctrine\DBAL\DriverManager::getConnection($params);
|
||||||
}
|
}
|
||||||
|
|
||||||
$conn = \Doctrine\DBAL\DriverManager::getConnection($params);
|
|
||||||
$conn->getSchemaManager()->dropAndCreateDatabase();
|
|
||||||
|
|
||||||
$conn->close();
|
|
||||||
$conn->connect();
|
|
||||||
|
|
||||||
return $conn;
|
return $conn;
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user