Esempio n. 1
0
 public function testAddConfigDuplicate()
 {
     $config = new NodeTypeConfig('Test', 'test');
     $this->nodeTypeRegistry->add($config);
     $this->nodeTypeRegistry->add($config);
     $configs = $this->nodeTypeRegistry->getConfigs();
     $this->assertCount(1, $configs);
     $this->assertEquals('test', $configs[0]->getType());
 }
Esempio n. 2
0
 /**
  * {@inheritdoc}
  */
 public function getNodeTypeConfig($nodeType)
 {
     foreach ($this->nodeTypeRegistry->getConfigs() as $nodeTypeConfig) {
         if ($nodeType === $nodeTypeConfig->getType()) {
             return $nodeTypeConfig;
         }
     }
     return null;
 }