diff --git a/airtime_mvc/tests/application/models/ShowTest.php b/airtime_mvc/tests/application/models/ShowTest.php index 2cfc41123..99b98bccf 100644 --- a/airtime_mvc/tests/application/models/ShowTest.php +++ b/airtime_mvc/tests/application/models/ShowTest.php @@ -248,4 +248,32 @@ class ShowTest extends Zend_Test_PHPUnit_DatabaseTestCase $ds ); } + + /* Tests the entire show gets deleted when the user selects 'Delete this + * instance and all following' from the context menu on the calendar + */ + public function testDeleteRepeatingShow() + { + TestHelper::loginUser(); + + $data = ShowData::getWeeklyRepeatNoEndNoRRData(); + $showService = new Application_Service_ShowService(null, $data); + + $showService->addUpdateShow($data); + $showService->deleteShow(1); + + $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 order by id'); + $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/test_deleteRepeatingShow.xml"), + $ds + ); + } } diff --git a/airtime_mvc/tests/application/models/files/test_deleteRepeatingShow.xml b/airtime_mvc/tests/application/models/files/test_deleteRepeatingShow.xml new file mode 100644 index 000000000..2da16a819 --- /dev/null +++ b/airtime_mvc/tests/application/models/files/test_deleteRepeatingShow.xml @@ -0,0 +1,17 @@ + + + +
+ + +
+ + +
+ + +
+ + +
+
\ No newline at end of file