protected function setUp() { $this->containerName = 'PdTests_MakeTests_BuilderTest'; $this->className = 'PdTests_stubs_Dummy'; $container = Pd_Container::get($this->containerName); // the map $map = new Pd_Map(); $item = new Pd_Map_Item(); $item->setDependencyName('Apple'); $item->setInjectAs('setApple'); $item->setInjectWith('method'); $map->add($item); $item = new Pd_Map_Item(); $item->setDependencyName('Banana'); $item->setInjectWith('constructor'); $map->add($item); $container->maps()->set($this->className, $map); // the dependencies $container->dependencies()->set('Apple', 'red'); $container->dependencies()->set('Banana', 'it was built!'); // construct it $this->builder = new Pd_Make_Constructor(); $this->builder->setContainer($container); $this->builder->setClassName($this->className); }
/** * Loads a map based on the set class name * * If there is no map in the container, then it will try to build * a map by reading the class. * */ protected function loadMap() { $this->_getMapFromContainer(); if ($this->_map->count() == 0) { $this->_buildMap(); $this->_saveMapToContainer(); } }
public function testHasShouldNotHave() { $this->assertFalse($this->map->has('testType')); }