private function _createInputObjects() { $this->_dispatcher = new RoverDispatcher(); $platoStr = array_shift($this->_inputLines); $platoTopCoordinates = CoordinatesFactory::create($platoStr); $this->_dispatcher->setPlato(new Plato($platoTopCoordinates)); for ($i = 0; $i < count($this->_inputLines); $i++) { if ($i % 2) { $this->_commandSequences[] = new CommandSequence($this->_inputLines[$i]); } else { $this->_roverPositions[] = RoverPositionFactory::create($this->_inputLines[$i]); } } foreach ($this->_commandSequences as $index => $commandSequence) { $this->_dispatcher->addRover($this->_roverPositions[$index], $commandSequence); } }
public function testArgsPositionFactory() { $this->setExpectedException('Rover\\Exceptions\\RoverFactoryException'); \Rover\Factory\RoverPositionFactory::create('1 10'); }