expectException(ParametersException::class); run($input); } else { $output = run($input); $this->assertEquals($expected, $output); } } /** * @dataProvider generatedDataProvider */ public function testBoardCounts($input, $expected) { $input['boards'] = strval($input['over39_boards'] ? rand(40, 60) : rand(1, 39)); unset($input['over39_boards']); $this->testRandomResults($input, $expected); } public function generatedDataProvider() { $contents = file(dirname(__FILE__) . '/tests.txt'); $count = count($contents) / 2; for ($i = 0; $i < $count; $i += 2) { $input = []; parse_str(http_build_query(json_decode($contents[$i], TRUE)), $input); yield [$input, json_decode($contents[$i+1], TRUE)]; } } } ?>