public function testConstruct()
 {
     $a = array(1, 2, 'key3' => 3);
     $map = new CMap($a);
     $this->assertEquals(3, $map->getCount());
     $map2 = new CMap($this->map);
     $this->assertEquals(2, $map2->getCount());
 }
Exemple #2
0
 public function testRecursiveMergeWithTraversable()
 {
     $map = new CMap();
     $obj = new ArrayObject(array('k1' => $this->item1, 'k2' => $this->item2, 'k3' => new ArrayObject(array('k4' => $this->item3))));
     $map->mergeWith($obj, true);
     $this->assertEquals(3, $map->getCount());
     $this->assertEquals($this->item1, $map['k1']);
     $this->assertEquals($this->item2, $map['k2']);
     $this->assertEquals($this->item3, $map['k3']['k4']);
 }