Esempio n. 1
0
 protected function setUp()
 {
     $this->containerName = 'PdTests_MakeTests_MakeTest';
     $this->className = 'PdTests_stubs_Dummy';
     $container = Pd_Container::get($this->containerName);
     $container->dependencies()->set('Force', 'a forced var');
     $container->dependencies()->set('Pear', 'a fruit');
     $container->dependencies()->set('Apple', 'red!!!');
     $this->object = Pd_Make::name($this->className, $this->containerName);
 }
Esempio n. 2
0
 /**
  * Finds the dependency, new class or pulls from container, based
  * on item.
  *
  * @param Pd_Map_Item $item
  * @return mixed dependency
  */
 protected function getDependencyForItem($item)
 {
     if ($item->newClass()) {
         $dependency = Pd_Make::name($item->newClass(), $this->_container->name());
     } else {
         $dependency = $this->_container->dependencies()->get($item->dependencyName());
     }
     return $dependency;
 }