diff --git a/airtime_mvc/tests/application/bootstrap.php b/airtime_mvc/tests/application/bootstrap.php
index bb5bdb43e..54b634f05 100644
--- a/airtime_mvc/tests/application/bootstrap.php
+++ b/airtime_mvc/tests/application/bootstrap.php
@@ -43,6 +43,9 @@ set_include_path(APPLICATION_PATH . '/services' . PATH_SEPARATOR . get_include_p
//Controller plugins.
set_include_path(APPLICATION_PATH . '/controllers/plugins' . PATH_SEPARATOR . get_include_path());
+//test data
+set_include_path(APPLICATION_PATH . '/../tests/application/testdata' . 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());
diff --git a/airtime_mvc/tests/application/models/ShowTest.php b/airtime_mvc/tests/application/models/ShowTest.php
index 8b93e6dad..c26ac054a 100644
--- a/airtime_mvc/tests/application/models/ShowTest.php
+++ b/airtime_mvc/tests/application/models/ShowTest.php
@@ -3,6 +3,7 @@ require_once "Zend/Test/PHPUnit/DatabaseTestCase.php";
require_once "ShowService.php";
require_once "../application/configs/conf.php";
require_once "AirtimeInstall.php";
+require_once "ShowData.php";
class ShowTest extends Zend_Test_PHPUnit_DatabaseTestCase
{
@@ -103,4 +104,29 @@ class ShowTest extends Zend_Test_PHPUnit_DatabaseTestCase
$ds
);
}
+
+ /* Tests that a non-repeating, non-record, and non-rebroadcast show
+ * gets created properly
+ */
+ public function testNoRepeatNoRRShowCreated()
+ {
+ $data = ShowData::getNoRepeatNoRRData();
+ $showService = new Application_Service_ShowService();
+
+ $showService->addUpdateShow($data);
+
+ $ds = new Zend_Test_PHPUnit_Db_DataSet_QueryDataSet(
+ $this->getConnection()
+ );
+ $ds->addTable('cc_show', 'select * from cc_show');
+ $ds->addTable('cc_show_days', 'select * from cc_show_days');
+ $ds->addTable('cc_show_instances', 'select * from cc_show_instances');
+ $ds->addTable('cc_show_rebroadcast', 'select * from cc_show_rebroadcast');
+ $ds->addTable('cc_show_hosts', 'select * from cc_show_hosts');
+
+ $this->assertDataSetsEqual(
+ $this->createXmlDataSet(dirname(__FILE__)."/files/cc_show_insertIntoAssertion.xml"),
+ $ds
+ );
+ }
}
diff --git a/airtime_mvc/tests/application/models/files/cc_show_seed.xml b/airtime_mvc/tests/application/models/files/cc_show_seed.xml
index 2bef820ad..988499585 100644
--- a/airtime_mvc/tests/application/models/files/cc_show_seed.xml
+++ b/airtime_mvc/tests/application/models/files/cc_show_seed.xml
@@ -14,5 +14,47 @@