CC-5651: Unit Test the Scheduler

This commit is contained in:
drigato 2014-01-27 17:17:03 -05:00
parent 55665fb246
commit a59453cde5
2 changed files with 128 additions and 0 deletions

View File

@ -511,4 +511,35 @@ class ShowServiceDbTest extends Zend_Test_PHPUnit_DatabaseTestCase
$ds
);
}
public function testEditRepeatingShowChangeNoEndOption()
{
TestHelper::loginUser();
/** Test changing the no end option on a weekly repeating show **/
$data = ShowServiceData::getWeeklyRepeatNoEndNoRRData();
$showService = new Application_Service_ShowService(null, $data);
$showService->addUpdateShow($data);
$data["add_show_end_date"] = '2016-01-09';
$data["add_show_no_end"] = 0;
$data["add_show_id"] = 1;
$showService = new Application_Service_ShowService(null, $data, true);
$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_editRepeatingShowChangeNoEndOption.xml"),
$ds
);
}
}

View File

@ -0,0 +1,97 @@
<?xml version="1.0" ?>
<dataset>
<table name="cc_show">
<column>id</column>
<column>name</column>
<column>url</column>
<column>genre</column>
<column>description</column>
<column>color</column>
<column>background_color</column>
<column>live_stream_using_airtime_auth</column>
<column>live_stream_using_custom_auth</column>
<column>live_stream_user</column>
<column>live_stream_pass</column>
<column>linked</column>
<column>is_linkable</column>
<row>
<value>1</value>
<value>test show</value>
<null />
<null />
<null />
<value>ffffff</value>
<value>364492</value>
<value></value>
<value></value>
<null />
<null />
<value></value>
<value>1</value>
</row>
</table>
<table name="cc_show_days">
<column>id</column>
<column>first_show</column>
<column>last_show</column>
<column>start_time</column>
<column>timezone</column>
<column>duration</column>
<column>day</column>
<column>repeat_type</column>
<column>next_pop_date</column>
<column>show_id</column>
<column>record</column>
<row>
<value>1</value>
<value>2016-01-01</value>
<value>2016-01-10</value>
<value>00:00:00</value>
<value>UTC</value>
<value>01:00</value>
<value>5</value>
<value>0</value>
<value>2016-01-15</value>
<value>1</value>
<value>0</value>
</row>
</table>
<table name="cc_show_instances">
<column>id</column>
<column>starts</column>
<column>ends</column>
<column>show_id</column>
<column>record</column>
<column>rebroadcast</column>
<column>instance_id</column>
<column>modified_instance</column>
<row>
<value>1</value>
<value>2016-01-01 00:00:00</value>
<value>2016-01-01 01:00:00</value>
<value>1</value>
<value>0</value>
<value>0</value>
<null />
<value></value>
</row>
<row>
<value>2</value>
<value>2016-01-08 00:00:00</value>
<value>2016-01-08 01:00:00</value>
<value>1</value>
<value>0</value>
<value>0</value>
<null />
<value></value>
</row>
</table>
<table name="cc_show_rebroadcast">
</table>
<table name="cc_show_hosts">
</table>
</dataset>