/** * @dataProvider assocMixedValues */ public function testThatAddRangeReindexesCollection(\Pinq\ICollection $collection, array $data) { $newData = [1, 2, 3, 4, 5]; $collection->addRange($newData); $amountOfValues = count($data) + count($newData); $this->assertEquals($amountOfValues === 0 ? [] : range(0, $amountOfValues - 1), array_keys($collection->asArray())); }
/** * @dataProvider everything */ public function testThatRemoveRemovesAllValuesFromCollection(\Pinq\ICollection $collection, array $data) { foreach ($collection->asArray() as $value) { $collection->remove($value); } $this->assertMatchesValues($collection, []); }
/** * @dataProvider everything */ public function testThatRemoveRangeRemovesAllValuesFromCollection(\Pinq\ICollection $collection, array $data) { $collection->removeRange($collection->asArray()); $this->assertMatchesValues($collection, []); }