public function testInit()
 {
     $col = new ItemCollection();
     $it = new ItemFactory();
     $col->setName("test");
     $col->setItemFactory($it);
     $col->addItem("foo", "bar", "foo");
     $col->foo2 = $it->make('foo2', 'bar', 'Foo2');
     $this->assertEquals($col->foo->value, $col['foo2']['value']);
     return $col;
 }
 /**
  * creates a new instance of the ItemCollection
  * @return RicAnthonyLee\Itemizer\ItemCollection
  **/
 public function make($name, $value = false, $alias = false)
 {
     $collection = new ItemCollection();
     $collection->setName($name);
     if ($value) {
         $collection->setItem($value);
     }
     if ($alias) {
         $collection->setAlias($alias);
     }
     return $collection;
 }
 /**
  * set the configuration callback/map for the __call magic method
  * @return void
  **/
 protected function __setCallbacks()
 {
     parent::__setCallbacks();
     $this->mergeCallbackMap(["add" => "addParameter"]);
 }