CC-5651: Unit Test the Scheduler

Added test for weekly repeat show R&R show creation
This commit is contained in:
drigato 2014-01-27 15:10:42 -05:00
parent 697e50c50d
commit 55665fb246
3 changed files with 374 additions and 2 deletions

View file

@ -464,11 +464,11 @@ class ShowServiceDbTest extends Zend_Test_PHPUnit_DatabaseTestCase
);
}
/** Test the creation of a single record and rebroadcast show **/
/** Test the creation of a single record and rebroadcast(RR) show **/
public function testCreateNoRepeatRRShow()
{
TestHelper::loginUser();
$data = ShowServiceData::getNoRepeatRRData();
$showService = new Application_Service_ShowService(null, $data);
$showService->addUpdateShow($data);
@ -487,4 +487,28 @@ class ShowServiceDbTest extends Zend_Test_PHPUnit_DatabaseTestCase
$ds
);
}
/** Test the creation of a weekly repeating, record and rebroadcast(RR) show **/
public function testCreateWeeklyRepeatRRShow()
{
TestHelper::loginUser();
$data = ShowServiceData::getWeeklyRepeatRRData();
$showService = new Application_Service_ShowService(null, $data);
$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 id, starts, ends, show_id, record, rebroadcast, instance_id, modified_instance 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__)."/datasets/test_createWeeklyRepeatRRShow.xml"),
$ds
);
}
}