CC-5651: Unit Test the Scheduler

* Got the database connection working in our unit test
This commit is contained in:
Albert Santoni 2013-12-18 17:40:13 -05:00
parent 083ca601c9
commit 1cf5d3489e
2 changed files with 12 additions and 3 deletions

View File

@ -35,4 +35,5 @@ if (file_exists('/usr/share/php/libzend-framework-php')) {
} }
require_once 'Zend/Application.php'; require_once 'Zend/Application.php';
require_once 'Zend/Config.php';
#require_once 'DatabaseTestCase.php'; #require_once 'DatabaseTestCase.php';

View File

@ -20,8 +20,16 @@ class ShowTest extends Zend_Test_PHPUnit_DatabaseTestCase
public function getConnection() public function getConnection()
{ {
if ($this->_connectionMock == null) { if ($this->_connectionMock == null) {
$config = new Zend_Config_Ini(APPLICATION_PATH . '/configs/application.ini', 'production'); $config = new Zend_Config(
$connection = Zend_Db::factory($config->db); 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( $this->_connectionMock = $this->createZendDbConnection(
$connection, $connection,
@ -73,4 +81,4 @@ class ShowTest extends Zend_Test_PHPUnit_DatabaseTestCase
$ds $ds
); );
} }
} }