DerivativeTest.php in Zircon Profile 8.0
File
core/modules/system/src/Tests/Plugin/DerivativeTest.php
View source
<?php
namespace Drupal\system\Tests\Plugin;
class DerivativeTest extends PluginTestBase {
function testDerivativeDecorator() {
$this
->assertEqual($this->mockBlockManager
->getDefinitions(), $this->mockBlockExpectedDefinitions);
foreach ($this->mockBlockExpectedDefinitions as $id => $definition) {
$this
->assertEqual($this->mockBlockManager
->getDefinition($id), $definition);
}
$this
->assertIdentical($this->mockBlockManager
->getDefinition('non_existing', FALSE), NULL, 'NULL returned as the definition of a non-existing base plugin.');
$this
->assertIdentical($this->mockBlockManager
->getDefinition('menu:non_existing', FALSE), NULL, 'NULL returned as the definition of a non-existing derivative plugin.');
$this
->assertIdentical($this->mockBlockManager
->getDefinition('menu', FALSE), NULL, 'NULL returned as the definition of a base plugin that may not be used without deriving.');
}
}