Exemplo n.º 1
0
 /**
  * Tests the getDefinition() method.
  */
 public function testGetDefinition()
 {
     $definitions = $this->discovery->getDefinitions();
     // Test the getDefinition() method.
     foreach ($this->expectedKeys as $expected_key) {
         $this->assertEquals($definitions[$expected_key], $this->discovery->getDefinition($expected_key));
     }
 }
Exemplo n.º 2
0
 /**
  * Gets the plugin discovery.
  *
  * @return \Drupal\Component\Plugin\Discovery\DiscoveryInterface
  */
 protected function getDiscovery()
 {
     if (!isset($this->discovery)) {
         $yaml_discovery = new YamlDiscovery('links.menu', $this->moduleHandler->getModuleDirectories());
         $yaml_discovery->addTranslatableProperty('title', 'title_context');
         $yaml_discovery->addTranslatableProperty('description', 'description_context');
         $this->discovery = new ContainerDerivativeDiscoveryDecorator($yaml_discovery);
     }
     return $this->discovery;
 }
Exemplo n.º 3
0
 /**
  * {@inheritdoc}
  */
 public function getDefinitions()
 {
     return parent::getDefinitions() + $this->decorated->getDefinitions();
 }