CC-5651: Unit Test the Scheduler
* Got the database connection working in our unit test
This commit is contained in:
parent
42aebe50af
commit
6026ec58db
|
@ -35,4 +35,5 @@ if (file_exists('/usr/share/php/libzend-framework-php')) {
|
|||
}
|
||||
|
||||
require_once 'Zend/Application.php';
|
||||
require_once 'Zend/Config.php';
|
||||
#require_once 'DatabaseTestCase.php';
|
||||
|
|
|
@ -20,8 +20,16 @@ class ShowTest extends Zend_Test_PHPUnit_DatabaseTestCase
|
|||
public function getConnection()
|
||||
{
|
||||
if ($this->_connectionMock == null) {
|
||||
$config = new Zend_Config_Ini(APPLICATION_PATH . '/configs/application.ini', 'production');
|
||||
$connection = Zend_Db::factory($config->db);
|
||||
$config = new Zend_Config(
|
||||
array(
|
||||
'host' => '127.0.0.1',
|
||||
'dbname' => 'airtime_test',
|
||||
'username' => 'airtime',
|
||||
'password' => 'airtime'
|
||||
)
|
||||
);
|
||||
var_dump($config);
|
||||
$connection = Zend_Db::factory('pdo_pgsql', $config);
|
||||
|
||||
$this->_connectionMock = $this->createZendDbConnection(
|
||||
$connection,
|
||||
|
@ -73,4 +81,4 @@ class ShowTest extends Zend_Test_PHPUnit_DatabaseTestCase
|
|||
$ds
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue