protected function YamlDiscoveryDecoratorTest::setUp in Drupal 9
Same name and namespace in other branches
- 8 core/tests/Drupal/Tests/Core/Plugin/Discovery/YamlDiscoveryDecoratorTest.php \Drupal\Tests\Core\Plugin\Discovery\YamlDiscoveryDecoratorTest::setUp()
- 10 core/tests/Drupal/Tests/Core/Plugin/Discovery/YamlDiscoveryDecoratorTest.php \Drupal\Tests\Core\Plugin\Discovery\YamlDiscoveryDecoratorTest::setUp()
Overrides UnitTestCase::setUp
File
- core/
tests/ Drupal/ Tests/ Core/ Plugin/ Discovery/ YamlDiscoveryDecoratorTest.php, line 36
Class
- YamlDiscoveryDecoratorTest
- YamlDiscoveryDecorator unit tests.
Namespace
Drupal\Tests\Core\Plugin\DiscoveryCode
protected function setUp() : void {
parent::setUp();
$base_path = __DIR__ . '/Fixtures';
// Set up the directories to search.
$directories = [
'test_1' => $base_path . '/test_1',
'test_2' => $base_path . '/test_2',
];
$definitions = [
'decorated_test_1' => [
'id' => 'decorated_test_1',
'name' => 'Decorated test 1',
'provider' => 'decorated_1',
],
'decorated_test_2' => [
'id' => 'decorated_test_2',
'name' => 'Decorated test 1',
'provider' => 'decorated_2',
],
];
$decorated = $this
->createMock('Drupal\\Component\\Plugin\\Discovery\\DiscoveryInterface');
$decorated
->expects($this
->once())
->method('getDefinitions')
->will($this
->returnValue($definitions));
$this->discoveryDecorator = new YamlDiscoveryDecorator($decorated, 'test', $directories);
}