From ae6efc8fc8c19cabe570a3d1198d84b584c93373 Mon Sep 17 00:00:00 2001
From: Albert Santoni <albert.santoni@sourcefabric.org>
Date: Wed, 18 Dec 2013 16:05:31 -0500
Subject: [PATCH] CC-5651: Unit Test the Scheduler

* Unit test bootstrapping work.
* Added a README.txt for the unit testing environment
---
 airtime_mvc/tests/README.txt                | 15 +++++++++++++++
 airtime_mvc/tests/application/bootstrap.php | 21 ++++++++++++++++++++-
 2 files changed, 35 insertions(+), 1 deletion(-)
 create mode 100644 airtime_mvc/tests/README.txt

diff --git a/airtime_mvc/tests/README.txt b/airtime_mvc/tests/README.txt
new file mode 100644
index 000000000..1672b89aa
--- /dev/null
+++ b/airtime_mvc/tests/README.txt
@@ -0,0 +1,15 @@
+To get the Airtime unit tests running:
+==========================
+
+1) Install PHPUnit
+
+wget https://phar.phpunit.de/phpunit.phar
+chmod +x phpunit.phar
+sudo mv phpunit.phar /usr/local/bin/phpunit
+
+2) Install the DbUnit extension
+
+sudo pear channel-discover pear.phpunit.de
+sudo pear channel-discover pear.symfony.com
+sudo pear install --alldeps phpunit/DbUnit
+
diff --git a/airtime_mvc/tests/application/bootstrap.php b/airtime_mvc/tests/application/bootstrap.php
index 0db02c69f..d11b2e346 100644
--- a/airtime_mvc/tests/application/bootstrap.php
+++ b/airtime_mvc/tests/application/bootstrap.php
@@ -15,5 +15,24 @@ set_include_path(implode(PATH_SEPARATOR, array(
     get_include_path(),
 )));
 
+// Ensure library/ is on include_path
+set_include_path(implode(PATH_SEPARATOR, array(
+    get_include_path(),
+    realpath(APPLICATION_PATH . '/../library')
+)));
+
+set_include_path(APPLICATION_PATH . '/common' . PATH_SEPARATOR . get_include_path());
+
+//Propel classes.
+set_include_path(APPLICATION_PATH . '/models' . PATH_SEPARATOR . get_include_path());
+
+//Controller plugins.
+set_include_path(APPLICATION_PATH . '/controllers/plugins' . PATH_SEPARATOR . get_include_path());
+
+//Zend framework
+if (file_exists('/usr/share/php/libzend-framework-php')) {
+    set_include_path('/usr/share/php/libzend-framework-php' . PATH_SEPARATOR . get_include_path());
+}
+
 require_once 'Zend/Application.php';
-#require_once 'DatabaseTestCase.php';
\ No newline at end of file
+#require_once 'DatabaseTestCase.php';