protected function execute(InputInterface $input, OutputInterface $output) { $instructions = file_get_contents(__DIR__ . '/instructions.txt'); $elevator = new Elevator(); $instructionParser = new InstructionParser($elevator); $instructionParser->parseInstructions($instructions); $output->writeln('Puzzle 1 answer: ' . $elevator->getFloor()); }
/** * @test * @dataProvider getInstructions */ public function close_causes_entering_basement_at_position_one(string $instructions, int $expectedPosition) { $this->parser->parseInstructions($instructions); static::assertEquals($expectedPosition, $this->floorObserver->getInstructionPosition()); }