Rename airtime_mvc/ to legacy/

This commit is contained in:
jo 2021-10-11 13:43:25 +02:00
parent f0879322c2
commit 3e18d42c8b
1316 changed files with 0 additions and 0 deletions

View file

@ -0,0 +1,675 @@
<?php
require_once "../application/configs/conf.php";
/*
* All dates in the xml files are hard coded and in the year 2044
* It would have been nice to use 'PHPUnit/Extensions/Database/DataSet/ReplacementDataSet.php'
* to be able to use variables in the xml dataset files so dates can be relative. This proved
* not practical for Airtime; For repeating shows, the start times are always varying and would
* require functions that calculate the start and end dates, and the next populate date. The
* tests would be performing the same work as the application and require tests themselves.
*/
class ShowServiceDbTest extends Zend_Test_PHPUnit_DatabaseTestCase
{
private $_connectionMock;
//private $_nowDT;
public function setUp()
{
TestHelper::installTestDatabase();
TestHelper::setupZendBootstrap();
//$this->_nowDT = new DateTime("now", new DateTimeZone("UTC"));
parent::setUp();
}
public function getConnection()
{
if ($this->_connectionMock == null) {
$config = TestHelper::getDbZendConfig();
$connection = Zend_Db::factory('pdo_pgsql', $config);
$this->_connectionMock = $this->createZendDbConnection(
$connection,
'airtimeunittests'
);
Zend_Db_Table_Abstract::setDefaultAdapter($connection);
}
return $this->_connectionMock;
}
/* Defines how the initial state of the database should look before each test is executed
* Called once during setUp() and gets recreated for each new test
*/
public function getDataSet()
{
return new PHPUnit_Extensions_Database_DataSet_YamlDataSet(
__DIR__ . '/datasets/seed_show_service.yml'
);
}
public function testCcShowInsertedIntoDatabase()
{
$showService = new Application_Service_ShowService();
$data = array(
"add_show_id" => -1,
"add_show_name" => "test show",
"add_show_description" => null,
"add_show_url" => null,
"add_show_genre" => null,
"add_show_color" => "ffffff",
"add_show_background_color" => "364492",
"cb_airtime_auth" => false,
"cb_custom_auth" => false,
"custom_username" => null,
"custom_password" => null,
"add_show_linked" => false,
"add_show_has_autoplaylist" => 0,
"add_show_autoplaylist_id" => null,
"add_show_autoplaylist_repeat" => 0
);
$showService->setCcShow($data);
$ds = new Zend_Test_PHPUnit_Db_DataSet_QueryDataSet(
$this->getConnection()
);
$ds->addTable('cc_show', 'select * from cc_show');
$this->assertDataSetsEqual(
new PHPUnit_Extensions_Database_DataSet_YamlDataSet(__DIR__ . "/datasets/test_ccShowInsertedIntoDatabase.yml"),
$ds
);
}
/* Tests that a non-repeating, non-record, and non-rebroadcast show
* gets created properly
*/
public function testCreateNoRepeatNoRRShow()
{
TestHelper::loginUser();
$data = ShowServiceData::getNoRepeatNoRRData();
$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(
new PHPUnit_Extensions_Database_DataSet_YamlDataSet(__DIR__ . '/datasets/test_createNoRepeatNoRRShow.yml'),
$ds
);
}
/* Tests that a weekly repeating, non-record, non-rebroadcast show
* with no end date gets created correctly
*/
public function testCreateWeeklyRepeatNoEndNoRRShow()
{
TestHelper::loginUser();
$data = ShowServiceData::getWeeklyRepeatNoEndNoRRData();
$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(
new PHPUnit_Extensions_Database_DataSet_YamlDataSet(__DIR__ . '/datasets/test_createWeeklyRepeatNoEndNoRRShow.yml'),
$ds
);
}
public function testCreateBiWeeklyRepeatNoEndNoRRShow()
{
TestHelper::loginUser();
$data = ShowServiceData::getWeeklyRepeatNoEndNoRRData();
$data["add_show_repeat_type"] = "1";
$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(
new PHPUnit_Extensions_Database_DataSet_YamlDataSet(__DIR__ . '/datasets/test_createBiWeeklyRepeatNoEndNoRRShow.yml'),
$ds
);
}
public function testCreateTriWeeklyRepeatNoEndNoRRShow()
{
TestHelper::loginUser();
$data = ShowServiceData::getWeeklyRepeatNoEndNoRRData();
$data["add_show_repeat_type"] = "4";
$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(
new PHPUnit_Extensions_Database_DataSet_YamlDataSet(__DIR__ . '/datasets/test_createTriWeeklyRepeatNoEndNoRRShow.yml'),
$ds
);
}
public function testCreateQuadWeeklyRepeatNoEndNoRRShow()
{
TestHelper::loginUser();
$data = ShowServiceData::getWeeklyRepeatNoEndNoRRData();
$data["add_show_repeat_type"] = "5";
$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(
new PHPUnit_Extensions_Database_DataSet_YamlDataSet(__DIR__ . "/datasets/test_createQuadWeeklyRepeatNoEndNoRRShow.yml"),
$ds
);
}
public function testCreateMonthlyMonthlyRepeatNoEndNoRRShow()
{
TestHelper::loginUser();
$data = ShowServiceData::getWeeklyRepeatNoEndNoRRData();
$data["add_show_repeat_type"] = "2";
$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(
new PHPUnit_Extensions_Database_DataSet_YamlDataSet(__DIR__ . "/datasets/test_createMonthlyMonthlyRepeatNoEndNoRRShow.yml"),
$ds
);
}
public function testCreateMonthlyWeeklyRepeatNoEndNoRRShow()
{
TestHelper::loginUser();
$data = ShowServiceData::getWeeklyRepeatNoEndNoRRData();
$data["add_show_repeat_type"] = "3";
$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(
new PHPUnit_Extensions_Database_DataSet_YamlDataSet(__DIR__ . "/datasets/test_createMonthlyWeeklyRepeatNoEndNoRRShow.yml"),
$ds
);
}
/* Tests that a show instance gets deleted from it's repeating sequence properly
*/
public function testDeleteShowInstance()
{
TestHelper::loginUser();
$data = ShowServiceData::getWeeklyRepeatNoEndNoRRData();
$service_show = new Application_Service_ShowService(null, $data);
$service_show->addUpdateShow($data);
$service_show->deleteShow(3, true);
$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(
new PHPUnit_Extensions_Database_DataSet_YamlDataSet(__DIR__ . "/datasets/test_deleteShowInstance.yml"),
$ds
);
}
/* Tests that when a user selects 'Delete this instance and all following
* on the calendar the database gets updated correctly
*/
public function testDeleteShowInstanceAndAllFollowing()
{
TestHelper::loginUser();
$data = ShowServiceData::getWeeklyRepeatNoEndNoRRData();
$data["add_show_day_check"] = array(5,1,2);
$service_show = new Application_Service_ShowService(null, $data);
$service_show->addUpdateShow($data);
//delete some single instances first
$service_show->deleteShow(1, true);
$service_show->deleteShow(6, true);
$service_show->deleteShow(8, true);
//delete all instances including and after where id=4
$service_show->deleteShow(4);
$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 order by first_show');
$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(
new PHPUnit_Extensions_Database_DataSet_YamlDataSet(__DIR__ . "/datasets/test_deleteShowInstanceAndAllFollowing.yml"),
$ds
);
}
public function testEditRepeatingShowInstance()
{
TestHelper::loginUser();
$data = ShowServiceData::getWeeklyRepeatNoEndNoRRData();
$showService = new Application_Service_ShowService(null, $data);
$showService->addUpdateShow($data);
//move the start date forward one week and the start time forward one hour
$editData = ShowServiceData::getEditRepeatInstanceData();
//need to create a new service so it gets constructed with the new data
$showService = new Application_Service_ShowService(null, $editData);
$showService->editRepeatingShowInstance($editData);
$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(
new PHPUnit_Extensions_Database_DataSet_YamlDataSet(__DIR__ . "/datasets/test_editRepeatingShowInstance.yml"),
$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 = ShowServiceData::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(
new PHPUnit_Extensions_Database_DataSet_YamlDataSet(__DIR__ . "/datasets/test_deleteRepeatingShow.yml"),
$ds
);
}
public function testRepeatShowCreationWhenUserMovesForwardInCalendar()
{
TestHelper::loginUser();
$data = ShowServiceData::getWeeklyRepeatNoEndNoRRData();
$data["add_show_repeat_type"] = "1";
$showService = new Application_Service_ShowService(null, $data);
$showService->addUpdateShow($data);
//simulate the user moves forward in the calendar
$end = new DateTime("2044-03-12", new DateTimeZone("UTC"));
$showService->delegateInstanceCreation(null, $end, true);
$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(
new PHPUnit_Extensions_Database_DataSet_YamlDataSet(__DIR__ . "/datasets/test_repeatShowCreationWhenUserMovesForwardInCalendar.yml"),
$ds
);
}
public function testLinkedShow()
{
TestHelper::loginUser();
/** Test creating a linked show **/
$data = ShowServiceData::getWeeklyRepeatNoEndNoRRData();
$data["add_show_linked"] = 1;
$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(
new PHPUnit_Extensions_Database_DataSet_YamlDataSet(__DIR__ . "/datasets/test_createLinkedShow.yml"),
$ds
);
}
/** 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);
$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(
new PHPUnit_Extensions_Database_DataSet_YamlDataSet(__DIR__ . "/datasets/test_createNoRepeatRRShow.yml"),
$ds
);
}
/** Test the creation of a weekly repeating, record and rebroadcast(RR) show **/
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"] = '2044-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(
new PHPUnit_Extensions_Database_DataSet_YamlDataSet(__DIR__ . "/datasets/test_editRepeatingShowChangeNoEndOption.yml"),
$ds
);
}
/**
* Tests that when you remove the first repeat show day, which changes
* the show's first instance start date, updates the scheduled content
* correctly
*/
public function testRemoveFirstRepeatShowDayUpdatesScheduleCorrectly()
{
TestHelper::loginUser();
$data = ShowServiceData::getWeeklyRepeatNoEndNoRRData();
$data["add_show_start_date"] = "2044-01-29";
$data["add_show_day_check"] = array(5,6);
$data["add_show_linked"] = 1;
$showService = new Application_Service_ShowService(null, $data);
$showService->addUpdateShow($data);
//insert some fake tracks into cc_schedule table
$ccFiles = new CcFiles();
$ccFiles
->setDbCueIn("00:00:00")
->setDbCueOut("00:04:32")
->save();
$scheduleItems = array(
0 => array(
"id" => 0,
"instance" => 1,
"timestamp" => time()
)
);
$mediaItems = array(
0 => array(
"id" => 1,
"type" => "audioclip"
)
);
$scheduler = new Application_Model_Scheduler();
$scheduler->scheduleAfter($scheduleItems, $mediaItems);
//delete the first repeat day
$data["add_show_day_check"] = array(6);
$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');
$ds->addTable('cc_schedule', 'select id, starts, ends, file_id, clip_length, fade_in, fade_out, cue_in, cue_out, instance_id, playout_status from cc_schedule');
$this->assertDataSetsEqual(
new PHPUnit_Extensions_Database_DataSet_YamlDataSet(__DIR__ . "/datasets/test_removeFirstRepeatShowDayUpdatesScheduleCorrectly.yml"),
$ds
);
}
public function testChangeRepeatDayUpdatesScheduleCorrectly()
{
TestHelper::loginUser();
$data = ShowServiceData::getWeeklyRepeatNoEndNoRRData();
$data["add_show_start_date"] = "2044-01-29";
$data["add_show_day_check"] = array(5, 6);
$data["add_show_linked"] = 1;
$showService = new Application_Service_ShowService(null, $data);
$showService->addUpdateShow($data);
//insert some fake tracks into cc_schedule table
$ccFiles = new CcFiles();
$ccFiles
->setDbCueIn("00:00:00")
->setDbCueOut("00:04:32")
->save();
$scheduleItems = array(
0 => array(
"id" => 0,
"instance" => 1,
"timestamp" => time()
)
);
$mediaItems = array(
0 => array(
"id" => 1,
"type" => "audioclip"
)
);
$scheduler = new Application_Model_Scheduler();
$scheduler->scheduleAfter($scheduleItems, $mediaItems);
//delete the first repeat day
$data["add_show_day_check"] = array(6);
$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');
$ds->addTable('cc_schedule', 'select id, starts, ends, file_id, clip_length, fade_in, fade_out, cue_in, cue_out, instance_id, playout_status from cc_schedule');
$this->assertDataSetsEqual(
new PHPUnit_Extensions_Database_DataSet_YamlDataSet(__DIR__ . "/datasets/test_changeRepeatDayUpdatesScheduleCorrectly.yml"),
$ds
);
}
public function testChangeRepeatTypeFromWeeklyToNoRepeat()
{
TestHelper::loginUser();
//test change repeat type from weekly to no-repeat
$data = ShowServiceData::getWeeklyRepeatNoEndNoRRData();
$showService = new Application_Service_ShowService(null, $data);
$showService->addUpdateShow($data);
$data["add_show_repeats"] = 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(
new PHPUnit_Extensions_Database_DataSet_YamlDataSet(__DIR__ . "/datasets/test_weeklyToNoRepeat.yml"),
$ds
);
}
public function testChangeRepeatTypeFromWeeklyToBiWeekly()
{
TestHelper::loginUser();
//test change repeat type weekly to bi-weekly
$data = ShowServiceData::getWeeklyRepeatNoEndNoRRData();
$showService = new Application_Service_ShowService(null, $data);
$showService->addUpdateShow($data);
$data["add_show_id"] = 1;
$data["add_show_repeat_type"] = 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(
new PHPUnit_Extensions_Database_DataSet_YamlDataSet(__DIR__ . "/datasets/test_weeklyToBiWeekly.yml"),
$ds
);
}
}

View file

@ -0,0 +1,11 @@
cc_pref:
-
id: '1'
subjid: null
keystr: shows_populated_until
valstr: '2044-02-07 00:00:00'
-
id: '2'
subjid: null
keystr: timezone
valstr: UTC

View file

@ -0,0 +1,19 @@
cc_show:
-
id: '1'
name: 'test show'
url: null
genre: null
description: null
color: ffffff
background_color: '364492'
live_stream_using_airtime_auth: false
live_stream_using_custom_auth: false
live_stream_user: null
live_stream_pass: null
linked: false
is_linkable: true
image_path: ''
has_autoplaylist: false
autoplaylist_id: null
autoplaylist_repeat: false

View file

@ -0,0 +1,79 @@
cc_show:
-
id: '1'
name: 'test show'
url: null
genre: null
description: null
color: ffffff
background_color: '364492'
live_stream_using_airtime_auth: false
live_stream_using_custom_auth: false
live_stream_user: null
live_stream_pass: null
linked: true
is_linkable: true
image_path: ''
has_autoplaylist: false
autoplaylist_id: null
autoplaylist_repeat: false
cc_show_days:
-
id: '2'
first_show: '2044-01-30'
last_show: null
start_time: '00:00:00'
timezone: UTC
duration: '01:00'
day: '6'
repeat_type: '0'
next_pop_date: '2044-02-13'
show_id: '1'
record: '0'
cc_show_instances:
-
id: '3'
starts: '2044-01-30 00:00:00'
ends: '2044-01-30 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '0'
instance_id: null
modified_instance: false
-
id: '4'
starts: '2044-02-06 00:00:00'
ends: '2044-02-06 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '0'
instance_id: null
modified_instance: false
cc_schedule:
-
id: '3'
starts: '2044-01-30 00:00:00'
ends: '2044-01-30 00:04:32'
file_id: '1'
clip_length: '00:04:32'
fade_in: '00:00:00.5'
fade_out: '00:00:00.5'
cue_in: '00:00:00'
cue_out: '00:04:32'
instance_id: '3'
playout_status: '1'
-
id: '4'
starts: '2044-02-06 00:00:00'
ends: '2044-02-06 00:04:32'
file_id: '1'
clip_length: '00:04:32'
fade_in: '00:00:00.5'
fade_out: '00:00:00.5'
cue_in: '00:00:00'
cue_out: '00:04:32'
instance_id: '4'
playout_status: '1'
cc_show_rebroadcast:
cc_show_hosts:

View file

@ -0,0 +1,63 @@
cc_show:
-
id: '1'
name: 'test show'
url: null
genre: null
description: null
color: ffffff
background_color: '364492'
live_stream_using_airtime_auth: false
live_stream_using_custom_auth: false
live_stream_user: null
live_stream_pass: null
linked: false
is_linkable: true
image_path: ''
has_autoplaylist: false
autoplaylist_id: null
autoplaylist_repeat: false
cc_show_days:
-
id: '1'
first_show: '2044-01-01'
last_show: null
start_time: '00:00:00'
timezone: UTC
duration: '01:00'
day: '5'
repeat_type: '1'
next_pop_date: '2044-02-12'
show_id: '1'
record: '0'
cc_show_instances:
-
id: '1'
starts: '2044-01-01 00:00:00'
ends: '2044-01-01 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '0'
instance_id: null
modified_instance: false
-
id: '2'
starts: '2044-01-15 00:00:00'
ends: '2044-01-15 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '0'
instance_id: null
modified_instance: false
-
id: '3'
starts: '2044-01-29 00:00:00'
ends: '2044-01-29 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '0'
instance_id: null
modified_instance: false
cc_show_rebroadcast:
cc_show_hosts:

View file

@ -0,0 +1,90 @@
cc_show:
-
id: '1'
name: 'test show'
url: null
genre: null
description: null
color: ffffff
background_color: '364492'
live_stream_using_airtime_auth: false
live_stream_using_custom_auth: false
live_stream_user: null
live_stream_pass: null
linked: true
is_linkable: true
image_path: ''
has_autoplaylist: false
autoplaylist_id: null
autoplaylist_repeat: false
cc_show_days:
-
id: '1'
first_show: '2044-01-01'
last_show: null
start_time: '00:00:00'
timezone: UTC
duration: '01:00'
day: '5'
repeat_type: '0'
next_pop_date: '2044-02-12'
show_id: '1'
record: '0'
cc_show_instances:
-
id: '1'
starts: '2044-01-01 00:00:00'
ends: '2044-01-01 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '0'
instance_id: null
modified_instance: false
-
id: '2'
starts: '2044-01-08 00:00:00'
ends: '2044-01-08 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '0'
instance_id: null
modified_instance: false
-
id: '3'
starts: '2044-01-15 00:00:00'
ends: '2044-01-15 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '0'
instance_id: null
modified_instance: false
-
id: '4'
starts: '2044-01-22 00:00:00'
ends: '2044-01-22 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '0'
instance_id: null
modified_instance: false
-
id: '5'
starts: '2044-01-29 00:00:00'
ends: '2044-01-29 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '0'
instance_id: null
modified_instance: false
-
id: '6'
starts: '2044-02-05 00:00:00'
ends: '2044-02-05 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '0'
instance_id: null
modified_instance: false
cc_show_rebroadcast:
cc_show_hosts:

View file

@ -0,0 +1,54 @@
cc_show:
-
id: '1'
name: 'test show'
url: null
genre: null
description: null
color: ffffff
background_color: '364492'
live_stream_using_airtime_auth: false
live_stream_using_custom_auth: false
live_stream_user: null
live_stream_pass: null
linked: false
is_linkable: true
image_path: ''
has_autoplaylist: false
autoplaylist_id: null
autoplaylist_repeat: false
cc_show_days:
-
id: '1'
first_show: '2044-01-01'
last_show: null
start_time: '00:00:00'
timezone: UTC
duration: '01:00'
day: null
repeat_type: '2'
next_pop_date: '2044-03-01'
show_id: '1'
record: '0'
cc_show_instances:
-
id: '1'
starts: '2044-01-01 00:00:00'
ends: '2044-01-01 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '0'
instance_id: null
modified_instance: false
-
id: '2'
starts: '2044-02-01 00:00:00'
ends: '2044-02-01 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '0'
instance_id: null
modified_instance: false
cc_show_rebroadcast:
cc_show_hosts:

View file

@ -0,0 +1,54 @@
cc_show:
-
id: '1'
name: 'test show'
url: null
genre: null
description: null
color: ffffff
background_color: '364492'
live_stream_using_airtime_auth: false
live_stream_using_custom_auth: false
live_stream_user: null
live_stream_pass: null
linked: false
is_linkable: true
image_path: ''
has_autoplaylist: false
autoplaylist_id: null
autoplaylist_repeat: false
cc_show_days:
-
id: '1'
first_show: '2044-01-01'
last_show: null
start_time: '00:00:00'
timezone: UTC
duration: '01:00'
day: '5'
repeat_type: '3'
next_pop_date: '2044-03-04'
show_id: '1'
record: '0'
cc_show_instances:
-
id: '1'
starts: '2044-01-01 00:00:00'
ends: '2044-01-01 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '0'
instance_id: null
modified_instance: false
-
id: '2'
starts: '2044-02-05 00:00:00'
ends: '2044-02-05 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '0'
instance_id: null
modified_instance: false
cc_show_rebroadcast:
cc_show_hosts:

View file

@ -0,0 +1,45 @@
cc_show:
-
id: '1'
name: 'test show'
url: null
genre: null
description: null
color: ffffff
background_color: '364492'
live_stream_using_airtime_auth: false
live_stream_using_custom_auth: false
live_stream_user: null
live_stream_pass: null
linked: false
is_linkable: true
image_path: ''
has_autoplaylist: false
autoplaylist_id: null
autoplaylist_repeat: false
cc_show_days:
-
id: '1'
first_show: '2044-01-01'
last_show: null
start_time: '00:00:00'
timezone: UTC
duration: '01:00'
day: '5'
repeat_type: '-1'
next_pop_date: '2044-01-01'
show_id: '1'
record: '0'
cc_show_instances:
-
id: '1'
starts: '2044-01-01 00:00:00'
ends: '2044-01-01 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '0'
instance_id: null
modified_instance: false
cc_show_rebroadcast:
cc_show_hosts:

View file

@ -0,0 +1,185 @@
cc_show:
-
id: '1'
name: 'test show'
url: null
genre: null
description: null
color: ffffff
background_color: '364492'
live_stream_using_airtime_auth: false
live_stream_using_custom_auth: false
live_stream_user: null
live_stream_pass: null
linked: false
is_linkable: true
image_path: ''
has_autoplaylist: false
autoplaylist_id: null
autoplaylist_repeat: false
cc_show_days:
-
id: '1'
first_show: '2044-01-01'
last_show: null
start_time: '00:00:00'
timezone: UTC
duration: '01:00'
day: '5'
repeat_type: '-1'
next_pop_date: '2044-01-01'
show_id: '1'
record: '1'
cc_show_instances:
-
id: '1'
starts: '2044-01-01 00:00:00'
ends: '2044-01-01 01:00:00'
show_id: '1'
record: '1'
rebroadcast: '0'
instance_id: null
modified_instance: false
-
id: '2'
starts: '2044-01-02 00:00:00'
ends: '2044-01-02 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '1'
instance_id: '1'
modified_instance: false
-
id: '3'
starts: '2044-01-03 00:00:00'
ends: '2044-01-03 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '1'
instance_id: '1'
modified_instance: false
-
id: '4'
starts: '2044-01-04 00:00:00'
ends: '2044-01-04 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '1'
instance_id: '1'
modified_instance: false
-
id: '5'
starts: '2044-01-05 00:00:00'
ends: '2044-01-05 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '1'
instance_id: '1'
modified_instance: false
-
id: '6'
starts: '2044-01-06 00:00:00'
ends: '2044-01-06 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '1'
instance_id: '1'
modified_instance: false
-
id: '7'
starts: '2044-01-07 00:00:00'
ends: '2044-01-07 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '1'
instance_id: '1'
modified_instance: false
-
id: '8'
starts: '2044-01-08 00:00:00'
ends: '2044-01-08 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '1'
instance_id: '1'
modified_instance: false
-
id: '9'
starts: '2044-01-09 00:00:00'
ends: '2044-01-09 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '1'
instance_id: '1'
modified_instance: false
-
id: '10'
starts: '2044-01-10 00:00:00'
ends: '2044-01-10 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '1'
instance_id: '1'
modified_instance: false
-
id: '11'
starts: '2044-01-11 00:00:00'
ends: '2044-01-11 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '1'
instance_id: '1'
modified_instance: false
cc_show_rebroadcast:
-
id: '1'
day_offset: '1 days'
start_time: '00:00:00'
show_id: '1'
-
id: '2'
day_offset: '2 days'
start_time: '00:00:00'
show_id: '1'
-
id: '3'
day_offset: '3 days'
start_time: '00:00:00'
show_id: '1'
-
id: '4'
day_offset: '4 days'
start_time: '00:00:00'
show_id: '1'
-
id: '5'
day_offset: '5 days'
start_time: '00:00:00'
show_id: '1'
-
id: '6'
day_offset: '6 days'
start_time: '00:00:00'
show_id: '1'
-
id: '7'
day_offset: '7 days'
start_time: '00:00:00'
show_id: '1'
-
id: '8'
day_offset: '8 days'
start_time: '00:00:00'
show_id: '1'
-
id: '9'
day_offset: '9 days'
start_time: '00:00:00'
show_id: '1'
-
id: '10'
day_offset: '10 days'
start_time: '00:00:00'
show_id: '1'
cc_show_hosts:

View file

@ -0,0 +1,54 @@
cc_show:
-
id: '1'
name: 'test show'
url: null
genre: null
description: null
color: ffffff
background_color: '364492'
live_stream_using_airtime_auth: false
live_stream_using_custom_auth: false
live_stream_user: null
live_stream_pass: null
linked: false
is_linkable: true
image_path: ''
has_autoplaylist: false
autoplaylist_id: null
autoplaylist_repeat: false
cc_show_days:
-
id: '1'
first_show: '2044-01-01'
last_show: null
start_time: '00:00:00'
timezone: UTC
duration: '01:00'
day: '5'
repeat_type: '5'
next_pop_date: '2044-02-26'
show_id: '1'
record: '0'
cc_show_instances:
-
id: '1'
starts: '2044-01-01 00:00:00'
ends: '2044-01-01 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '0'
instance_id: null
modified_instance: false
-
id: '2'
starts: '2044-01-29 00:00:00'
ends: '2044-01-29 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '0'
instance_id: null
modified_instance: false
cc_show_rebroadcast:
cc_show_hosts:

View file

@ -0,0 +1,54 @@
cc_show:
-
id: '1'
name: 'test show'
url: null
genre: null
description: null
color: ffffff
background_color: '364492'
live_stream_using_airtime_auth: false
live_stream_using_custom_auth: false
live_stream_user: null
live_stream_pass: null
linked: false
is_linkable: true
image_path: ''
has_autoplaylist: false
autoplaylist_id: null
autoplaylist_repeat: false
cc_show_days:
-
id: '1'
first_show: '2044-01-01'
last_show: null
start_time: '00:00:00'
timezone: UTC
duration: '01:00'
day: '5'
repeat_type: '4'
next_pop_date: '2044-02-12'
show_id: '1'
record: '0'
cc_show_instances:
-
id: '1'
starts: '2044-01-01 00:00:00'
ends: '2044-01-01 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '0'
instance_id: null
modified_instance: false
-
id: '2'
starts: '2044-01-22 00:00:00'
ends: '2044-01-22 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '0'
instance_id: null
modified_instance: false
cc_show_rebroadcast:
cc_show_hosts:

View file

@ -0,0 +1,90 @@
cc_show:
-
id: '1'
name: 'test show'
url: null
genre: null
description: null
color: ffffff
background_color: '364492'
live_stream_using_airtime_auth: false
live_stream_using_custom_auth: false
live_stream_user: null
live_stream_pass: null
linked: false
is_linkable: true
image_path: ''
has_autoplaylist: false
autoplaylist_id: null
autoplaylist_repeat: false
cc_show_days:
-
id: '1'
first_show: '2044-01-01'
last_show: null
start_time: '00:00:00'
timezone: UTC
duration: '01:00'
day: '5'
repeat_type: '0'
next_pop_date: '2044-02-12'
show_id: '1'
record: '0'
cc_show_instances:
-
id: '1'
starts: '2044-01-01 00:00:00'
ends: '2044-01-01 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '0'
instance_id: null
modified_instance: false
-
id: '2'
starts: '2044-01-08 00:00:00'
ends: '2044-01-08 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '0'
instance_id: null
modified_instance: false
-
id: '3'
starts: '2044-01-15 00:00:00'
ends: '2044-01-15 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '0'
instance_id: null
modified_instance: false
-
id: '4'
starts: '2044-01-22 00:00:00'
ends: '2044-01-22 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '0'
instance_id: null
modified_instance: false
-
id: '5'
starts: '2044-01-29 00:00:00'
ends: '2044-01-29 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '0'
instance_id: null
modified_instance: false
-
id: '6'
starts: '2044-02-05 00:00:00'
ends: '2044-02-05 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '0'
instance_id: null
modified_instance: false
cc_show_rebroadcast:
cc_show_hosts:

View file

@ -0,0 +1,208 @@
cc_show:
-
id: '1'
name: 'test show'
url: null
genre: null
description: null
color: ffffff
background_color: '364492'
live_stream_using_airtime_auth: false
live_stream_using_custom_auth: false
live_stream_user: null
live_stream_pass: null
linked: false
is_linkable: true
image_path: ''
has_autoplaylist: false
autoplaylist_id: null
autoplaylist_repeat: false
cc_show_days:
-
id: '1'
first_show: '2044-01-01'
last_show: null
start_time: '00:00:00'
timezone: UTC
duration: '01:00'
day: '5'
repeat_type: '0'
next_pop_date: '2044-02-12'
show_id: '1'
record: '1'
cc_show_instances:
-
id: '1'
starts: '2044-01-01 00:00:00'
ends: '2044-01-01 01:00:00'
show_id: '1'
record: '1'
rebroadcast: '0'
instance_id: null
modified_instance: false
-
id: '2'
starts: '2044-01-02 00:00:00'
ends: '2044-01-02 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '1'
instance_id: '1'
modified_instance: false
-
id: '3'
starts: '2044-01-03 12:00:00'
ends: '2044-01-03 13:00:00'
show_id: '1'
record: '0'
rebroadcast: '1'
instance_id: '1'
modified_instance: false
-
id: '4'
starts: '2044-01-08 00:00:00'
ends: '2044-01-08 01:00:00'
show_id: '1'
record: '1'
rebroadcast: '0'
instance_id: null
modified_instance: false
-
id: '5'
starts: '2044-01-09 00:00:00'
ends: '2044-01-09 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '1'
instance_id: '4'
modified_instance: false
-
id: '6'
starts: '2044-01-10 12:00:00'
ends: '2044-01-10 13:00:00'
show_id: '1'
record: '0'
rebroadcast: '1'
instance_id: '4'
modified_instance: false
-
id: '7'
starts: '2044-01-15 00:00:00'
ends: '2044-01-15 01:00:00'
show_id: '1'
record: '1'
rebroadcast: '0'
instance_id: null
modified_instance: false
-
id: '8'
starts: '2044-01-16 00:00:00'
ends: '2044-01-16 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '1'
instance_id: '7'
modified_instance: false
-
id: '9'
starts: '2044-01-17 12:00:00'
ends: '2044-01-17 13:00:00'
show_id: '1'
record: '0'
rebroadcast: '1'
instance_id: '7'
modified_instance: false
-
id: '10'
starts: '2044-01-22 00:00:00'
ends: '2044-01-22 01:00:00'
show_id: '1'
record: '1'
rebroadcast: '0'
instance_id: null
modified_instance: false
-
id: '11'
starts: '2044-01-23 00:00:00'
ends: '2044-01-23 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '1'
instance_id: '10'
modified_instance: false
-
id: '12'
starts: '2044-01-24 12:00:00'
ends: '2044-01-24 13:00:00'
show_id: '1'
record: '0'
rebroadcast: '1'
instance_id: '10'
modified_instance: false
-
id: '13'
starts: '2044-01-29 00:00:00'
ends: '2044-01-29 01:00:00'
show_id: '1'
record: '1'
rebroadcast: '0'
instance_id: null
modified_instance: false
-
id: '14'
starts: '2044-01-30 00:00:00'
ends: '2044-01-30 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '1'
instance_id: '13'
modified_instance: false
-
id: '15'
starts: '2044-01-31 12:00:00'
ends: '2044-01-31 13:00:00'
show_id: '1'
record: '0'
rebroadcast: '1'
instance_id: '13'
modified_instance: false
-
id: '16'
starts: '2044-02-05 00:00:00'
ends: '2044-02-05 01:00:00'
show_id: '1'
record: '1'
rebroadcast: '0'
instance_id: null
modified_instance: false
-
id: '17'
starts: '2044-02-06 00:00:00'
ends: '2044-02-06 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '1'
instance_id: '16'
modified_instance: false
-
id: '18'
starts: '2044-02-07 12:00:00'
ends: '2044-02-07 13:00:00'
show_id: '1'
record: '0'
rebroadcast: '1'
instance_id: '16'
modified_instance: false
cc_show_rebroadcast:
-
id: '1'
day_offset: '1 days'
start_time: '00:00:00'
show_id: '1'
-
id: '2'
day_offset: '2 days'
start_time: '12:00:00'
show_id: '1'
cc_show_hosts:

View file

@ -0,0 +1,6 @@
cc_show:
cc_show_days:
cc_show_instances:
cc_show_rebroadcast:
cc_show_hosts:

View file

@ -0,0 +1,90 @@
cc_show:
-
id: '1'
name: 'test show'
url: null
genre: null
description: null
color: ffffff
background_color: '364492'
live_stream_using_airtime_auth: false
live_stream_using_custom_auth: false
live_stream_user: null
live_stream_pass: null
linked: false
is_linkable: true
image_path: ''
has_autoplaylist: false
autoplaylist_id: null
autoplaylist_repeat: false
cc_show_days:
-
id: '1'
first_show: '2044-01-01'
last_show: null
start_time: '00:00:00'
timezone: UTC
duration: '01:00'
day: '5'
repeat_type: '0'
next_pop_date: '2044-02-12'
show_id: '1'
record: '0'
cc_show_instances:
-
id: '1'
starts: '2044-01-01 00:00:00'
ends: '2044-01-01 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '0'
instance_id: null
modified_instance: false
-
id: '2'
starts: '2044-01-08 00:00:00'
ends: '2044-01-08 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '0'
instance_id: null
modified_instance: false
-
id: '3'
starts: '2044-01-15 00:00:00'
ends: '2044-01-15 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '0'
instance_id: null
modified_instance: true
-
id: '4'
starts: '2044-01-22 00:00:00'
ends: '2044-01-22 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '0'
instance_id: null
modified_instance: false
-
id: '5'
starts: '2044-01-29 00:00:00'
ends: '2044-01-29 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '0'
instance_id: null
modified_instance: false
-
id: '6'
starts: '2044-02-05 00:00:00'
ends: '2044-02-05 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '0'
instance_id: null
modified_instance: false
cc_show_rebroadcast:
cc_show_hosts:

View file

@ -0,0 +1,204 @@
cc_show:
-
id: '1'
name: 'test show'
url: null
genre: null
description: null
color: ffffff
background_color: '364492'
live_stream_using_airtime_auth: false
live_stream_using_custom_auth: false
live_stream_user: null
live_stream_pass: null
linked: false
is_linkable: true
image_path: ''
has_autoplaylist: false
autoplaylist_id: null
autoplaylist_repeat: false
cc_show_days:
-
id: '1'
first_show: '2044-01-01'
last_show: '2044-01-16'
start_time: '00:00:00'
timezone: UTC
duration: '01:00'
day: '5'
repeat_type: '0'
next_pop_date: '2044-02-12'
show_id: '1'
record: '0'
-
id: '2'
first_show: '2044-01-04'
last_show: '2044-01-19'
start_time: '00:00:00'
timezone: UTC
duration: '01:00'
day: '1'
repeat_type: '0'
next_pop_date: '2044-02-08'
show_id: '1'
record: '0'
-
id: '3'
first_show: '2044-01-05'
last_show: '2044-01-20'
start_time: '00:00:00'
timezone: UTC
duration: '01:00'
day: '2'
repeat_type: '0'
next_pop_date: '2044-02-09'
show_id: '1'
record: '0'
cc_show_instances:
-
id: '1'
starts: '2044-01-01 00:00:00'
ends: '2044-01-01 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '0'
instance_id: null
modified_instance: true
-
id: '2'
starts: '2044-01-08 00:00:00'
ends: '2044-01-08 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '0'
instance_id: null
modified_instance: false
-
id: '3'
starts: '2044-01-15 00:00:00'
ends: '2044-01-15 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '0'
instance_id: null
modified_instance: false
-
id: '4'
starts: '2044-01-22 00:00:00'
ends: '2044-01-22 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '0'
instance_id: null
modified_instance: true
-
id: '5'
starts: '2044-01-29 00:00:00'
ends: '2044-01-29 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '0'
instance_id: null
modified_instance: true
-
id: '6'
starts: '2044-02-05 00:00:00'
ends: '2044-02-05 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '0'
instance_id: null
modified_instance: true
-
id: '7'
starts: '2044-01-04 00:00:00'
ends: '2044-01-04 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '0'
instance_id: null
modified_instance: false
-
id: '8'
starts: '2044-01-11 00:00:00'
ends: '2044-01-11 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '0'
instance_id: null
modified_instance: true
-
id: '9'
starts: '2044-01-18 00:00:00'
ends: '2044-01-18 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '0'
instance_id: null
modified_instance: false
-
id: '10'
starts: '2044-01-25 00:00:00'
ends: '2044-01-25 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '0'
instance_id: null
modified_instance: true
-
id: '11'
starts: '2044-02-01 00:00:00'
ends: '2044-02-01 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '0'
instance_id: null
modified_instance: true
-
id: '12'
starts: '2044-01-05 00:00:00'
ends: '2044-01-05 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '0'
instance_id: null
modified_instance: false
-
id: '13'
starts: '2044-01-12 00:00:00'
ends: '2044-01-12 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '0'
instance_id: null
modified_instance: false
-
id: '14'
starts: '2044-01-19 00:00:00'
ends: '2044-01-19 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '0'
instance_id: null
modified_instance: false
-
id: '15'
starts: '2044-01-26 00:00:00'
ends: '2044-01-26 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '0'
instance_id: null
modified_instance: true
-
id: '16'
starts: '2044-02-02 00:00:00'
ends: '2044-02-02 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '0'
instance_id: null
modified_instance: true
cc_show_rebroadcast:
cc_show_hosts:

View file

@ -0,0 +1,54 @@
cc_show:
-
id: '1'
name: 'test show'
url: null
genre: null
description: null
color: ffffff
background_color: '364492'
live_stream_using_airtime_auth: false
live_stream_using_custom_auth: false
live_stream_user: null
live_stream_pass: null
linked: false
is_linkable: true
image_path: ''
has_autoplaylist: false
autoplaylist_id: null
autoplaylist_repeat: false
cc_show_days:
-
id: '1'
first_show: '2044-01-01'
last_show: '2044-01-10'
start_time: '00:00:00'
timezone: UTC
duration: '01:00'
day: '5'
repeat_type: '0'
next_pop_date: '2044-01-15'
show_id: '1'
record: '0'
cc_show_instances:
-
id: '1'
starts: '2044-01-01 00:00:00'
ends: '2044-01-01 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '0'
instance_id: null
modified_instance: false
-
id: '2'
starts: '2044-01-08 00:00:00'
ends: '2044-01-08 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '0'
instance_id: null
modified_instance: false
cc_show_rebroadcast:
cc_show_hosts:

View file

@ -0,0 +1,111 @@
cc_show:
-
id: '1'
name: 'test show'
url: null
genre: null
description: null
color: ffffff
background_color: '364492'
live_stream_using_airtime_auth: false
live_stream_using_custom_auth: false
live_stream_user: null
live_stream_pass: null
linked: false
is_linkable: true
image_path: ''
has_autoplaylist: false
autoplaylist_id: null
autoplaylist_repeat: false
cc_show_days:
-
id: '1'
first_show: '2044-01-01'
last_show: null
start_time: '00:00:00'
timezone: UTC
duration: '01:00'
day: '5'
repeat_type: '0'
next_pop_date: '2044-02-12'
show_id: '1'
record: '0'
-
id: '2'
first_show: '2044-01-08'
last_show: '2044-01-09'
start_time: '01:00:00'
timezone: UTC
duration: '01:00'
day: '5'
repeat_type: '-1'
next_pop_date: '2044-01-08'
show_id: '1'
record: '0'
cc_show_instances:
-
id: '1'
starts: '2044-01-01 00:00:00'
ends: '2044-01-01 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '0'
instance_id: null
modified_instance: false
-
id: '2'
starts: '2044-01-08 00:00:00'
ends: '2044-01-08 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '0'
instance_id: null
modified_instance: true
-
id: '3'
starts: '2044-01-15 00:00:00'
ends: '2044-01-15 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '0'
instance_id: null
modified_instance: false
-
id: '4'
starts: '2044-01-22 00:00:00'
ends: '2044-01-22 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '0'
instance_id: null
modified_instance: false
-
id: '5'
starts: '2044-01-29 00:00:00'
ends: '2044-01-29 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '0'
instance_id: null
modified_instance: false
-
id: '6'
starts: '2044-02-05 00:00:00'
ends: '2044-02-05 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '0'
instance_id: null
modified_instance: false
-
id: '7'
starts: '2044-01-08 01:00:00'
ends: '2044-01-08 02:00:00'
show_id: '1'
record: '0'
rebroadcast: '0'
instance_id: null
modified_instance: false
cc_show_rebroadcast:
cc_show_hosts:

View file

@ -0,0 +1,79 @@
cc_show:
-
id: '1'
name: 'test show'
url: null
genre: null
description: null
color: ffffff
background_color: '364492'
live_stream_using_airtime_auth: false
live_stream_using_custom_auth: false
live_stream_user: null
live_stream_pass: null
linked: true
is_linkable: true
image_path: ''
has_autoplaylist: false
autoplaylist_id: null
autoplaylist_repeat: false
cc_show_days:
-
id: '2'
first_show: '2044-01-30'
last_show: null
start_time: '00:00:00'
timezone: UTC
duration: '01:00'
day: '6'
repeat_type: '0'
next_pop_date: '2044-02-13'
show_id: '1'
record: '0'
cc_show_instances:
-
id: '3'
starts: '2044-01-30 00:00:00'
ends: '2044-01-30 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '0'
instance_id: null
modified_instance: false
-
id: '4'
starts: '2044-02-06 00:00:00'
ends: '2044-02-06 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '0'
instance_id: null
modified_instance: false
cc_schedule:
-
id: '3'
starts: '2044-01-30 00:00:00'
ends: '2044-01-30 00:04:32'
file_id: '1'
clip_length: '00:04:32'
fade_in: '00:00:00.5'
fade_out: '00:00:00.5'
cue_in: '00:00:00'
cue_out: '00:04:32'
instance_id: '3'
playout_status: '1'
-
id: '4'
starts: '2044-02-06 00:00:00'
ends: '2044-02-06 00:04:32'
file_id: '1'
clip_length: '00:04:32'
fade_in: '00:00:00.5'
fade_out: '00:00:00.5'
cue_in: '00:00:00'
cue_out: '00:04:32'
instance_id: '4'
playout_status: '1'
cc_show_rebroadcast:
cc_show_hosts:

View file

@ -0,0 +1,90 @@
cc_show:
-
id: '1'
name: 'test show'
url: null
genre: null
description: null
color: ffffff
background_color: '364492'
live_stream_using_airtime_auth: false
live_stream_using_custom_auth: false
live_stream_user: null
live_stream_pass: null
linked: false
is_linkable: true
image_path: ''
has_autoplaylist: false
autoplaylist_id: null
autoplaylist_repeat: false
cc_show_days:
-
id: '1'
first_show: '2044-01-01'
last_show: null
start_time: '00:00:00'
timezone: UTC
duration: '01:00'
day: '5'
repeat_type: '1'
next_pop_date: '2044-03-25'
show_id: '1'
record: '0'
cc_show_instances:
-
id: '1'
starts: '2044-01-01 00:00:00'
ends: '2044-01-01 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '0'
instance_id: null
modified_instance: false
-
id: '2'
starts: '2044-01-15 00:00:00'
ends: '2044-01-15 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '0'
instance_id: null
modified_instance: false
-
id: '3'
starts: '2044-01-29 00:00:00'
ends: '2044-01-29 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '0'
instance_id: null
modified_instance: false
-
id: '4'
starts: '2044-02-12 00:00:00'
ends: '2044-02-12 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '0'
instance_id: null
modified_instance: false
-
id: '5'
starts: '2044-02-26 00:00:00'
ends: '2044-02-26 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '0'
instance_id: null
modified_instance: false
-
id: '6'
starts: '2044-03-11 00:00:00'
ends: '2044-03-11 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '0'
instance_id: null
modified_instance: false
cc_show_rebroadcast:
cc_show_hosts:

View file

@ -0,0 +1,90 @@
cc_show:
-
id: '1'
name: 'test show'
url: null
genre: null
description: null
color: ffffff
background_color: '364492'
live_stream_using_airtime_auth: false
live_stream_using_custom_auth: false
live_stream_user: null
live_stream_pass: null
linked: false
is_linkable: false
image_path: ''
has_autoplaylist: false
autoplaylist_id: null
autoplaylist_repeat: false
cc_show_days:
-
id: '1'
first_show: '2044-01-01'
last_show: null
start_time: '00:00:00'
timezone: UTC
duration: '01:00'
day: '5'
repeat_type: '0'
next_pop_date: '2044-02-12'
show_id: '1'
record: '0'
cc_show_instances:
-
id: '1'
starts: '2044-01-01 00:00:00'
ends: '2044-01-01 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '0'
instance_id: null
modified_instance: false
-
id: '2'
starts: '2044-01-08 00:00:00'
ends: '2044-01-08 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '0'
instance_id: null
modified_instance: false
-
id: '3'
starts: '2044-01-15 00:00:00'
ends: '2044-01-15 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '0'
instance_id: null
modified_instance: false
-
id: '4'
starts: '2044-01-22 00:00:00'
ends: '2044-01-22 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '0'
instance_id: null
modified_instance: false
-
id: '5'
starts: '2044-01-29 00:00:00'
ends: '2044-01-29 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '0'
instance_id: null
modified_instance: false
-
id: '6'
starts: '2044-02-05 00:00:00'
ends: '2044-02-05 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '0'
instance_id: null
modified_instance: false
cc_show_rebroadcast:
cc_show_hosts:

View file

@ -0,0 +1,63 @@
cc_show:
-
id: '1'
name: 'test show'
url: null
genre: null
description: null
color: ffffff
background_color: '364492'
live_stream_using_airtime_auth: false
live_stream_using_custom_auth: false
live_stream_user: null
live_stream_pass: null
linked: false
is_linkable: true
image_path: ''
has_autoplaylist: false
autoplaylist_id: null
autoplaylist_repeat: false
cc_show_days:
-
id: '2'
first_show: '2044-01-01'
last_show: null
start_time: '00:00:00'
timezone: UTC
duration: '01:00'
day: '5'
repeat_type: '1'
next_pop_date: '2044-02-12'
show_id: '1'
record: '0'
cc_show_instances:
-
id: '7'
starts: '2044-01-01 00:00:00'
ends: '2044-01-01 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '0'
instance_id: null
modified_instance: false
-
id: '8'
starts: '2044-01-15 00:00:00'
ends: '2044-01-15 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '0'
instance_id: null
modified_instance: false
-
id: '9'
starts: '2044-01-29 00:00:00'
ends: '2044-01-29 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '0'
instance_id: null
modified_instance: false
cc_show_rebroadcast:
cc_show_hosts:

View file

@ -0,0 +1,45 @@
cc_show:
-
id: '1'
name: 'test show'
url: null
genre: null
description: null
color: ffffff
background_color: '364492'
live_stream_using_airtime_auth: false
live_stream_using_custom_auth: false
live_stream_user: null
live_stream_pass: null
linked: false
is_linkable: true
image_path: ''
has_autoplaylist: false
autoplaylist_id: null
autoplaylist_repeat: false
cc_show_days:
-
id: '2'
first_show: '2044-01-01'
last_show: null
start_time: '00:00:00'
timezone: UTC
duration: '01:00'
day: '5'
repeat_type: '-1'
next_pop_date: '2044-01-01'
show_id: '1'
record: '0'
cc_show_instances:
-
id: '1'
starts: '2044-01-01 00:00:00'
ends: '2044-01-01 01:00:00'
show_id: '1'
record: '0'
rebroadcast: '0'
instance_id: null
modified_instance: false
cc_show_rebroadcast:
cc_show_hosts:

View file

@ -0,0 +1,139 @@
<?php
require_once "../application/configs/conf.php";
class ShowServiceUnitTest extends PHPUnit_Framework_TestCase
{
// needed for accessing private methods
protected $_reflectionOfShowService;
protected $_showService;
public function setUp()
{
$this->_reflectionOfShowService = new ReflectionClass('Application_Service_ShowService');
$this->_showService = new Application_Service_ShowService();
}
public function testFormatShowDuration()
{
$duration = Application_Service_ShowService::formatShowDuration("01h 00m");
$this->assertEquals("01:00", $duration);
$duration = Application_Service_ShowService::formatShowDuration("00h 05m");
$this->assertEquals("00:05", $duration);
$duration = Application_Service_ShowService::formatShowDuration("03h 55m");
$this->assertEquals("03:55", $duration);
}
public function testCalculateEndDate()
{
$method = $this->_reflectionOfShowService->getMethod('calculateEndDate');
$method->setAccessible(true);
$end = $method->invokeArgs($this->_showService, array(ShowServiceData::getNoRepeatNoRRData()));
$this->assertEquals(null, $end);
$end = $method->invokeArgs($this->_showService, array(ShowServiceData::getWeeklyRepeatWithEndNoRRData()));
$this->assertEquals(new DateTime("2044-01-27", new DateTimeZone("UTC")), $end);
$end = $method->invokeArgs($this->_showService, array(ShowServiceData::getWeeklyRepeatNoEndNoRRData()));
$this->assertEquals(null, $end);
}
public function testGetMonthlyWeeklyRepeatInterval()
{
$method = $this->_reflectionOfShowService->getMethod('getMonthlyWeeklyRepeatInterval');
$method->setAccessible(true);
$repeatInterval = $method->invokeArgs($this->_showService, array(new DateTime("2044-01-01"), new DateTimeZone("UTC")));
$this->assertEquals(array("first", "Friday"), $repeatInterval);
$repeatInterval = $method->invokeArgs($this->_showService, array(new DateTime("2044-01-12"), new DateTimeZone("UTC")));
$this->assertEquals(array("second", "Tuesday"), $repeatInterval);
$repeatInterval = $method->invokeArgs($this->_showService, array(new DateTime("2044-01-18"), new DateTimeZone("UTC")));
$this->assertEquals(array("third", "Monday"), $repeatInterval);
$repeatInterval = $method->invokeArgs($this->_showService, array(new DateTime("2044-01-28"), new DateTimeZone("UTC")));
$this->assertEquals(array("fourth", "Thursday"), $repeatInterval);
$repeatInterval = $method->invokeArgs($this->_showService, array(new DateTime("2044-01-30"), new DateTimeZone("UTC")));
$this->assertEquals(array("fifth", "Saturday"), $repeatInterval);
}
public function testGetNextMonthlyMonthlyRepeatDate()
{
$method = $this->_reflectionOfShowService->getMethod('getNextMonthlyMonthlyRepeatDate');
$method->setAccessible(true);
$next = $method->invokeArgs($this->_showService, array(new DateTime("2044-01-01"), "UTC", "00:00"));
$this->assertEquals(new DateTime("2044-02-01", new DateTimeZone("UTC")), $next);
$next = $method->invokeArgs($this->_showService, array(new DateTime("2044-01-30"), "UTC", "00:00"));
$this->assertEquals(new DateTime("2044-03-30", new DateTimeZone("UTC")), $next);
}
public function testGetNextMonthlyWeeklyRepeatDate()
{
$method = $this->_reflectionOfShowService->getMethod('getNextMonthlyWeeklyRepeatDate');
$method->setAccessible(true);
$next = $method->invokeArgs($this->_showService, array(
new DateTime("2044-02-01"), "UTC", "00:00", "first", "Friday"));
$this->assertEquals(new DateTime("2044-02-05", new DateTimeZone("UTC")), $next);
$next = $method->invokeArgs($this->_showService, array(
new DateTime("2044-02-01"), "UTC", "00:00", "fifth", "Saturday"));
$this->assertEquals(new DateTime("2044-04-30", new DateTimeZone("UTC")), $next);
$next = $method->invokeArgs($this->_showService, array(
new DateTime("2044-02-01"), "UTC", "00:00", "fourth", "Monday"));
$this->assertEquals(new DateTime("2044-02-22", new DateTimeZone("UTC")), $next);
}
public function testCreateUTCStartEndDateTime()
{
$method = $this->_reflectionOfShowService->getMethod('createUTCStartEndDateTime');
$method->setAccessible(true);
$utcTimezone = new DateTimeZone("UTC");
//America/Toronto
$localStartDT = new DateTime("2044-01-01 06:30", new DateTimeZone("America/Toronto"));
$localEndDT = new DateTime("2044-01-01 07:30", new DateTimeZone("America/Toronto"));
$dt = $method->invokeArgs($this->_showService, array($localStartDT, "01:00"));
$this->assertEquals(array(
$localStartDT->setTimezone($utcTimezone),$localEndDT->setTimezone($utcTimezone)), $dt);
//America/Toronto with offset for rebroadcast shows
$localStartDT = new DateTime("2044-01-01 06:30", new DateTimeZone("America/Toronto"));
$localEndDT = new DateTime("2044-01-01 07:30", new DateTimeZone("America/Toronto"));
$localRebroadcastStartDT = new DateTime("2044-01-02 06:30", new DateTimeZone("America/Toronto"));
$localRebroadcastEndDT = new DateTime("2044-01-02 07:30", new DateTimeZone("America/Toronto"));
$dt = $method->invokeArgs($this->_showService, array($localStartDT, "01:00",
array("days" => "1", "hours" => "06", "mins" => "30")));
$this->assertEquals(array(
$localRebroadcastStartDT->setTimezone($utcTimezone),$localRebroadcastEndDT->setTimezone($utcTimezone)), $dt);
//Australia/Brisbane
$localStartDT = new DateTime("2044-01-01 06:30", new DateTimeZone("Australia/Brisbane"));
$localEndDT = new DateTime("2044-01-01 07:30", new DateTimeZone("Australia/Brisbane"));
$dt = $method->invokeArgs($this->_showService, array($localStartDT, "01:00"));
$this->assertEquals(array(
$localStartDT->setTimezone($utcTimezone), $localEndDT->setTimezone($utcTimezone)), $dt);
//America/Vancouver
$localStartDT = new DateTime("2044-01-01 06:30", new DateTimeZone("America/Vancouver"));
$localEndDT = new DateTime("2044-01-01 07:30", new DateTimeZone("America/Vancouver"));
$dt = $method->invokeArgs($this->_showService, array($localStartDT, "01:00"));
$this->assertEquals(array(
$localStartDT->setTimezone($utcTimezone), $localEndDT->setTimezone($utcTimezone)), $dt);
}
}