Note that the values of array need to be valid keys, i.e. they need to be either integer or string.
If a value has several occurrences, the latest key will be used as its value, and all others will be lost.
/** * @test * @dataProvider flipExamples */ public function flipWorks($array, $expected) { $helper = new ArrayHelper(); $result = $helper->flip($array); $this->assertEquals($expected, $result); }