assertEquals($expectedCard, $actualCard); } #[DataProvider('cardGenerator')] public function testGetPoints(string $input, int $expectedPoints): void { $this->assertEquals($expectedPoints, Card::fromString($input)->getPoints()); } #[DataProvider('solveGenerator')] public function testSolve(string $inputFile, int $solution, int $solutionSecond): void { $solver = new D04($inputFile); $this->assertEquals($solution, $solver->solve()); $this->assertEquals($solutionSecond, $solver->solveSecond()); } public static function solveGenerator(): \Generator { yield [D04::EXAMPLE_INPUT_FILE, 13, 30]; //yield [D04::INPUT_FILE, 26426, 6227972]; } public static function cardGenerator(): \Generator { yield ['Card 1: 41 48 83 86 17 | 83 86 6 31 17 9 48 53', 8]; yield ['Card 2: 13 32 20 16 61 | 61 30 68 82 17 32 24 19', 2]; yield ['Card 3: 1 21 53 59 44 | 69 82 63 72 16 21 14 1', 2]; yield ['Card 4: 41 92 73 84 69 | 59 84 76 51 58 5 54 83', 1]; yield ['Card 5: 87 83 26 28 32 | 88 30 70 12 93 22 82 36', 0]; yield ['Card 6: 31 18 13 56 72 | 74 77 10 23 35 67 36 11', 0]; } }