You are here

public function ArrayPluginDefinitionDecoratorTest::testMergeOverrideArrayDefinition in Plugin 8.2

@covers ::mergeOverrideArrayDefinition

File

tests/src/Unit/PluginDefinition/ArrayPluginDefinitionDecoratorTest.php, line 392

Class

ArrayPluginDefinitionDecoratorTest
@coversDefaultClass \Drupal\plugin\PluginDefinition\ArrayPluginDefinitionDecorator

Namespace

Drupal\Tests\plugin\Unit\PluginDefinition

Code

public function testMergeOverrideArrayDefinition() {
  $other_definition = [
    'foo' => $this
      ->randomMachineName(),
    'label' => $this
      ->randomMachineName(),
  ];
  $this
    ->assertSame($this->sut, $this->sut
    ->mergeOverrideArrayDefinition($other_definition));
  $this
    ->assertSame($other_definition['foo'], $this->sut
    ->getArrayDefinition()['foo']);
  $this
    ->assertSame($other_definition['label'], $this->sut
    ->getArrayDefinition()['label']);
}