/**
  * Test the isValid method.
  */
 public function testIsValid()
 {
     $running = new RunningBroadcast(null, null, null, null);
     self::assertFalse($running->isValid(''));
     $running = new RunningBroadcast(1, null, null, null);
     self::assertFalse($running->isValid(''));
     $running = new RunningBroadcast(null, 2, null, null);
     self::assertFalse($running->isValid(''));
     $running = new RunningBroadcast(null, 2, 3, null);
     self::assertFalse($running->isValid(''));
     $running = new RunningBroadcast(1, 2, null, null);
     self::assertFalse($running->isValid(''));
     $running = new RunningBroadcast(1, 2, 3, 'unit');
     self::assertFalse($running->isValid('test'));
     $running = new RunningBroadcast(1, 2, 3, 'test');
     self::assertTrue($running->isValid('test'));
 }
 /**
  * Retrieve what is broadcasting.
  *
  * @return RunningBroadcast[]
  */
 protected function updateRunningBroadcasts()
 {
     $this->runningBroadcasts = array();
     $this->logger->debug('Retrieve running broadcasts');
     $processStrings = $this->schedulerCommands->getRunningProcesses();
     foreach ($processStrings as $processString) {
         $runningItem = new RunningBroadcast($this->schedulerCommands->getBroadcastId($processString), $this->schedulerCommands->getProcessId($processString), $this->schedulerCommands->getChannelId($processString), $this->schedulerCommands->getEnvironment($processString), $this->schedulerCommands->isMonitorStream($processString));
         if ($runningItem->isValid($this->schedulerCommands->getKernelEnvironment())) {
             $this->runningBroadcasts[] = $runningItem;
         }
     }
     return $this->runningBroadcasts;
 }