Exemplo n.º 1
0
 public function testFromReference()
 {
     $array = array('7' => 'seven', '19' => 'nineteen', '31' => 'thirty-one');
     $map = \Bonder\Collections\Map::fromReference($array);
     $this->assertEquals(3, $map->size());
     unset($array['19']);
     $this->assertEquals(2, $map->size());
     $map->remove('31');
     $this->assertEquals(1, $map->size());
     $this->assertTrue($map->isLinkedTo($array));
 }
Exemplo n.º 2
0
 /**
  * (non-PHPdoc)
  * @see Bonder.RequestFactory::createRequest()
  */
 public function createRequest(\Bonder\Collections\Map $uriVariables)
 {
     return new \Bonder\Http\MapsHttpRequest(\Bonder\Collections\Map::fromReference($_GET), \Bonder\Collections\Map::fromReference($_POST), \Bonder\Collections\Map::fromReference($_COOKIE), \Bonder\Collections\Map::fromReference($_SESSION), \Bonder\Collections\Map::fromReference($_SERVER), \Bonder\Collections\Map::fromReference($_FILES), $uriVariables);
 }