CC-5651: Unit Test the Scheduler
* Fixed the test airtime.conf a bit * Create the database tables and db properly
This commit is contained in:
parent
32e9edf644
commit
c94f51b9f6
3 changed files with 21 additions and 5 deletions
|
@ -1,29 +0,0 @@
|
|||
[database]
|
||||
host = localhost
|
||||
dbname = airtime_test
|
||||
dbuser = airtime
|
||||
dbpass = airtime
|
||||
|
||||
[rabbitmq]
|
||||
host = 127.0.0.1
|
||||
port = 5672
|
||||
user = airtime
|
||||
password = GTUR1HVMU7GPIO3FETKY
|
||||
vhost = /airtime
|
||||
|
||||
[general]
|
||||
api_key = H2NRICX6CM8F50CU123C
|
||||
web_server_user = www-data
|
||||
airtime_dir = /usr/share/airtime
|
||||
base_url = localhost
|
||||
base_port = 80
|
||||
base_dir = /
|
||||
cache_ahead_hours = 1
|
||||
|
||||
[monit]
|
||||
monit_user = guest
|
||||
monit_password = airtime
|
||||
|
||||
[soundcloud]
|
||||
connection_retries = 3
|
||||
time_between_retries = 60
|
|
@ -43,8 +43,6 @@ if (file_exists('/usr/share/php/libzend-framework-php')) {
|
|||
set_include_path('/usr/share/php/libzend-framework-php' . PATH_SEPARATOR . get_include_path());
|
||||
}
|
||||
|
||||
$_SERVER['AIRTIME_CONF'] = 'airtime.conf';
|
||||
|
||||
require_once 'Zend/Application.php';
|
||||
require_once 'Zend/Config.php';
|
||||
#require_once 'DatabaseTestCase.php';
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
require_once "Zend/Test/PHPUnit/DatabaseTestCase.php";
|
||||
require_once "ShowService.php";
|
||||
require_once "../application/configs/conf.php";
|
||||
require_once "AirtimeInstall.php";
|
||||
|
||||
class ShowTest extends Zend_Test_PHPUnit_DatabaseTestCase
|
||||
|
@ -12,10 +13,27 @@ class ShowTest extends Zend_Test_PHPUnit_DatabaseTestCase
|
|||
//XXX: Zend_Test_PHPUnit_DatabaseTestCase doesn't use this for whatever reason:
|
||||
//$this->bootstrap = array($this, 'appBootstrap');
|
||||
//So instead we just manually call the appBootstrap here:
|
||||
$this->appBootstrap();
|
||||
//TODO: Use AirtimeInstall.php to create the database and database tables
|
||||
//AirtimeInstall::createDatabase(blah blah);
|
||||
//AirtimeInstall::createDatabaseTables(blah blah);
|
||||
//Load Database parameters
|
||||
|
||||
//We need to load the config before our app bootstrap runs. The config
|
||||
//is normally
|
||||
$_SERVER['AIRTIME_CONF'] = 'airtime.conf';
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
|
||||
$dbuser = $CC_CONFIG['dsn']['username'];
|
||||
$dbpasswd = $CC_CONFIG['dsn']['password'];
|
||||
$dbname = $CC_CONFIG['dsn']['database'];
|
||||
$dbhost = $CC_CONFIG['dsn']['hostspec'];
|
||||
echo($dbuser);
|
||||
echo($dbpasswd);
|
||||
echo($dbname);
|
||||
echo($dbhost);
|
||||
AirtimeInstall::createDatabase();
|
||||
AirtimeInstall::createDatabaseTables($dbuser, $dbpasswd, $dbname, $dbhost);
|
||||
|
||||
$this->appBootstrap();
|
||||
|
||||
parent::setUp();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue