Пример #1
0
 /**
  * @expectedException RuntimeException
  */
 public function testMergeFail()
 {
     $map1 = new Map(["a" => 1, "b" => 2]);
     $seq = new Sequence(["c" => 3, "d" => 3]);
     $seq->merge($map1);
 }
Пример #2
0
 public function testMerge()
 {
     $set = new Set([1, 2, 3, 3]);
     $seq = new Sequence([4, 5, 6, 7, 4]);
     $set2 = $set->merge($seq->toSet());
     $this->assertTrue($set2 instanceof Set);
     $this->assertEquals([1, 2, 3, 4, 5, 6, 7], $set2->toArray());
 }
Пример #3
0
 /**
  * @see http://php.net/manual/fr/class.arrayaccess.php
  */
 public function offsetUnset($offset)
 {
     unset($this->flip[$this->toString($this->array[$offset])]);
     parent::offsetUnset($offset);
     return $this;
 }