rules = new RockGunWaterAirPaperSpongeHumanScissorsFire(); } public function testGetGestures() { $this->assertEquals(['R', 'G', 'W', 'A', 'P', 'O', 'H', 'S', 'F'], $this->rules->getGestures()); } /** * @dataProvider providerCompare * * @param string $gesture1 * @param string $gesture2 * @param int $expected */ public function testCompare(string $gesture1, string $gesture2, int $expected) { $this->assertSame($expected, $this->rules->compare($gesture1, $gesture2)); } public function providerCompare(): array { return [ ['R', 'R', 0], ['R', 'G', -1], ['R', 'W', -1], ['R', 'A', -1], ['R', 'P', -1], ['R', 'O', 1], ['R', 'H', 1], ['R', 'S', 1], ['R', 'F', 1], ['G', 'R', 1], ['G', 'G', 0], ['G', 'W', -1], ['G', 'A', -1], ['G', 'P', -1], ['G', 'O', -1], ['G', 'H', 1], ['G', 'S', 1], ['G', 'F', 1], ['W', 'R', 1], ['W', 'G', 1], ['W', 'W', 0], ['W', 'A', -1], ['W', 'P', -1], ['W', 'O', -1], ['W', 'H', -1], ['W', 'S', 1], ['W', 'F', 1], ['A', 'R', 1], ['A', 'G', 1], ['A', 'W', 1], ['A', 'A', 0], ['A', 'P', -1], ['A', 'O', -1], ['A', 'H', -1], ['A', 'S', -1], ['A', 'F', 1], ['P', 'R', 1], ['P', 'G', 1], ['P', 'W', 1], ['P', 'A', 1], ['P', 'P', 0], ['P', 'O', -1], ['P', 'H', -1], ['P', 'S', -1], ['P', 'F', -1], ['O', 'R', -1], ['O', 'G', 1], ['O', 'W', 1], ['O', 'A', 1], ['O', 'P', 1], ['O', 'O', 0], ['O', 'H', -1], ['O', 'S', -1], ['O', 'F', -1], ['H', 'R', -1], ['H', 'G', -1], ['H', 'W', 1], ['H', 'A', 1], ['H', 'P', 1], ['H', 'O', 1], ['H', 'H', 0], ['H', 'S', -1], ['H', 'F', -1], ['S', 'R', -1], ['S', 'G', -1], ['S', 'W', -1], ['S', 'A', 1], ['S', 'P', 1], ['S', 'O', 1], ['S', 'H', 1], ['S', 'S', 0], ['S', 'F', -1], ['F', 'R', -1], ['F', 'G', -1], ['F', 'W', -1], ['F', 'A', -1], ['F', 'P', 1], ['F', 'O', 1], ['F', 'H', 1], ['F', 'S', 1], ['F', 'F', 0], ]; } }