Example #1
0
 /**
  * @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()));
 }
Example #2
0
 /**
  * @dataProvider everything
  */
 public function testThatRemoveRemovesAllValuesFromCollection(\Pinq\ICollection $collection, array $data)
 {
     foreach ($collection->asArray() as $value) {
         $collection->remove($value);
     }
     $this->assertMatchesValues($collection, []);
 }
Example #3
0
 /**
  * @dataProvider everything
  */
 public function testThatRemoveRangeRemovesAllValuesFromCollection(\Pinq\ICollection $collection, array $data)
 {
     $collection->removeRange($collection->asArray());
     $this->assertMatchesValues($collection, []);
 }