Skip to content

Commit

Permalink
refs #4233 check if it creates the correct instance
Browse files Browse the repository at this point in the history
  • Loading branch information
tsteur committed Nov 13, 2013
1 parent 44a6d8c commit 3755bfa
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions tests/PHPUnit/Core/TravisEnvironmentTest.php
Expand Up @@ -13,8 +13,22 @@ public function testUsageOfCorrectMysqlAdapter()
{
$mysqlAdapter = getenv('MYSQL_ADAPTER');

if (!empty($mysqlAdapter)) {
$this->assertTrue(in_array($mysqlAdapter, array('PDO_MYSQL', 'MYSQLI')));
if (empty($mysqlAdapter)) {
return;
}

$this->assertTrue(in_array($mysqlAdapter, array('PDO_MYSQL', 'MYSQLI')));

$db = Piwik\Db::get();

switch ($mysqlAdapter) {
case 'PDO_MYSQL':
$this->assertInstanceOf('\Piwik\Db\Adapter\Pdo\Mysql', $db);
break;
case 'MYSQLI':
$this->assertInstanceOf('\Piwik\Db\Adapter\Mysqli', $db);
break;
}

}
}

0 comments on commit 3755bfa

Please sign in to comment.