예제 #1
0
 function testIsScheduleEmptyInRange()
 {
     $i = new ScheduleGroup();
     $this->groupIdCreated = $i->add('2011-10-10 01:30:23', $this->storedFile->getId());
     if (PEAR::isError($this->groupIdCreated)) {
         $this->fail($this->groupIdCreated->getMessage());
         return;
     }
     if (Schedule::isScheduleEmptyInRange('2011-10-10 01:30:23', '00:00:12.555')) {
         $this->fail("Reporting empty schedule when it isnt.");
         return;
     }
     //    echo "groupid: ".$this->groupIdCreated."\n";
     $success = $i->remove();
     if ($success === false) {
         $this->fail("Failed to delete schedule group.");
         return;
     }
     if (!Schedule::isScheduleEmptyInRange('2011-10-10 01:30:23', '00:00:12.555')) {
         $this->fail("Reporting booked schedule when it isnt.");
         return;
     }
 }
    if (PEAR::isError($mediaFile)) {
        var_dump($mediaFile);
        exit;
    }
}
$pl->addAudioClip($mediaFile->getId());
echo "done.\n";
//$pl2 = Playlist::findPlaylistByName("pypo_playlist_test");
//var_dump($pl2);
// Get current time
// In the format YYYY-MM-DD HH:MM:SS.nnnnnn
$startTime = date("Y-m-d H:i:s");
$endTime = date("Y-m-d H:i:s", time() + 60 * 60);
echo "Removing everything from the scheduler between {$startTime} and {$endTime}...";
// Check for succces
$scheduleClear = Schedule::isScheduleEmptyInRange($startTime, "01:00:00");
if (!$scheduleClear) {
    echo "\nERROR: Schedule could not be cleared.\n\n";
    var_dump(Schedule::GetItems($startTime, $endTime));
    exit;
}
echo "done.\n";
// Schedule the playlist for two minutes from now
echo "Scheduling new playlist...\n";
//$playTime = date("Y-m-d H:i:s", time()+(60*$minutesFromNow));
$playTime = date("Y-m-d H:i:s", time() + $secondsFromNow);
//$scheduleGroup = new ScheduleGroup();
//$scheduleGroup->add($playTime, null, $pl->getId());
//$show = new ShowInstance($showInstanceId);
//$show->scheduleShow(array($pl->getId()));
//$show->setShowStart();