public function ArrayPluginDefinitionDecoratorTest::testMergeOverrideDefinition in Plugin 8.2
@covers ::mergeOverrideDefinition @covers ::doMergeOverrideDefinition @covers ::validateMergeDefinition @covers ::isDefinitionCompatible
@depends testMergeOverrideArrayDefinition
File
- tests/
src/ Unit/ PluginDefinition/ ArrayPluginDefinitionDecoratorTest.php, line 411
Class
- ArrayPluginDefinitionDecoratorTest
- @coversDefaultClass \Drupal\plugin\PluginDefinition\ArrayPluginDefinitionDecorator
Namespace
Drupal\Tests\plugin\Unit\PluginDefinitionCode
public function testMergeOverrideDefinition() {
$other_definition = new ArrayPluginDefinitionDecorator();
$other_definition['foo'] = $this
->randomMachineName();
$other_definition['label'] = $this
->randomMachineName();
$this
->assertSame($this->sut, $this->sut
->mergeOverrideDefinition($other_definition));
$this
->assertSame($other_definition['foo'], $this->sut
->getArrayDefinition()['foo']);
$this
->assertSame($other_definition['label'], $this->sut
->getArrayDefinition()['label']);
}