Example #1
0
 /**
  * {@inheritdoc}
  */
 public function getTreeConfig($slug)
 {
     foreach ($this->treeRegistry->getConfigs() as $config) {
         if ($slug === $config->getSlug()) {
             return $config;
         }
     }
     return null;
 }
Example #2
0
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     $this->treeManager = $this->getMock('Tadcka\\Component\\Tree\\Model\\Manager\\TreeManagerInterface');
     $this->treeManager->expects($this->any())->method('create')->will($this->returnValue(new Tree()));
     $this->treeManager->expects($this->any())->method('getClass')->will($this->returnValue('Tadcka\\Component\\Tree\\Model\\Tree'));
     $this->treeRegistry = $this->getMock('Tadcka\\Component\\Tree\\Registry\\Tree\\TreeRegistry');
     $this->treeRegistry->expects($this->any())->method('getConfigs')->will($this->returnValue(array(new TreeConfig('Test', 'test'), new TreeConfig('Mock', 'mock'))));
     $this->treeProvider = new TreeProvider($this->treeManager, $this->treeRegistry);
 }