d02 = new D02(D02::TESTFILE); parent::setUp(); } public function testResult(): void { $this->assertEquals(8, $this->d02->solve()); } public function testReadInput(): void { $this->assertEquals(file(D02::TESTFILE), $this->d02->readData()); } public function testValidGames(): void { $configurationSet = [ new Set(12, 'red'), new Set(13, 'green'), new Set(14, 'blue'), ]; $games = $this->d02->getValidGames($configurationSet); $this->assertEquals(1, array_shift($games)->id); $this->assertEquals(2, array_shift($games)->id); $this->assertEquals(5, array_shift($games)->id); } public function testReadGames(): void { $games = $this->d02->getGames(); $this->assertEquals(1, array_shift($games)->id); $this->assertEquals(2, array_shift($games)->id); $this->assertEquals(3, array_shift($games)->id); $this->assertEquals(4, array_shift($games)->id); $this->assertEquals(5, array_shift($games)->id); } }