CC-5651: Unit Test the Scheduler

* Continued refactoring of the database creation.
* Database now persists after running tests but most of the tables are
  cleared.
* The unit tests run WAY faster now. :-)
This commit is contained in:
Albert Santoni 2014-01-23 17:04:29 -05:00
parent aa2e084a09
commit 162a873f9d
8 changed files with 109 additions and 18 deletions

View file

@ -211,13 +211,14 @@ class AirtimeInstall
{
$CC_CONFIG = Config::getConfig();
echo " * Creating Airtime database".PHP_EOL;
$database = $CC_CONFIG['dsn']['database'];
$username = $CC_CONFIG['dsn']['username'];
#$command = "echo \"CREATE DATABASE $database OWNER $username\" | su postgres -c psql 2>/dev/null";
echo $database . PHP_EOL;
echo " * Creating Airtime database: " . $database . PHP_EOL;
putenv("LC_ALL=en_CA.UTF-8"); //Squash warnings when running unit tests
$command = "su postgres -c \"psql -l | cut -f2 -d' ' | grep -w '{$database}'\";";
exec($command, $output, $rv);