Skip to content

Commit 2b6252b

Browse files
committed
[tests] connection configuration
Signed-off-by: Dorian Savina <[email protected]>
1 parent 12ae906 commit 2b6252b

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

phpunit.xml.dist

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@
1313
>
1414

1515
<php>
16-
<var name="db_url" value="mysql://root:@localhost/"/>
16+
<var name="db_host" value="localhost" />
17+
<var name="db_username" value="root" />
18+
<var name="db_password" value="" />
19+
<var name="db_driver" value="pdo_mysql"/>
1720
</php>
1821

1922
<testsuites>

tests/Mouf/Database/MagicQueryTest.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,12 +177,13 @@ public function testInvalidSql() {
177177
public function testWithCache()
178178
{
179179
global $db_url;
180-
$config = new \Doctrine\DBAL\Configuration();
181-
// TODO: put this in conf variable
182180
$connectionParams = array(
183-
'url' => $db_url,
181+
'user' => $GLOBALS['db_username'],
182+
'password' => $GLOBALS['db_password'],
183+
'host' => $GLOBALS['db_host'],
184+
'driver' => $GLOBALS['db_driver'],
184185
);
185-
$conn = \Doctrine\DBAL\DriverManager::getConnection($connectionParams, $config);
186+
$conn = \Doctrine\DBAL\DriverManager::getConnection($connectionParams);
186187

187188
$cache = new ArrayCache();
188189

0 commit comments

Comments
 (0)