Ejemplo n.º 1
0
 public function testRemoveWatchTube_fromMultiple()
 {
     $tubeStatus = new TubeStatus();
     $tubeStatus->addWatchedTube('tube-1');
     $tubeStatus->addWatchedTube('tube-2');
     $tubeStatus->addWatchedTube('tube-3');
     $tubeStatus->removeWatchedTube('tube-2');
     $this->assertEquals([Beanie::DEFAULT_TUBE, 'tube-1', 'tube-3'], $tubeStatus->getWatchedTubes());
 }
Ejemplo n.º 2
0
 /**
  * @param TubeStatus $goal
  * @param int $mode
  * @return \Beanie\Command\CommandInterface[]
  */
 public function calculateTransformationTo(TubeStatus $goal, $mode = self::TRANSFORM_BOTH)
 {
     $commands = [];
     if ($mode & self::TRANSFORM_WATCHED) {
         $commands = $this->calculateTransformWatched($goal->getWatchedTubes());
     }
     if ($mode & self::TRANSFORM_USE && $goal->getCurrentTube() !== $this->currentTube) {
         $commands[] = $this->commandFactory->create(CommandInterface::COMMAND_USE, [$goal->getCurrentTube()]);
     }
     return $commands;
 }