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