You are here

public function MergeablePluginDefinitionTraitTest::testMergeDefaultDefinition in Plugin 8.2

@covers ::mergeDefaultDefinition @covers ::isDefinitionCompatible @covers ::doMergeDefaultDefinition

File

tests/src/Unit/PluginDefinition/MergeablePluginDefinitionTraitTest.php, line 37

Class

MergeablePluginDefinitionTraitTest
@coversDefaultClass \Drupal\plugin\PluginDefinition\MergeablePluginDefinitionTrait @group Plugin

Namespace

Drupal\Tests\plugin\Unit\PluginDefinition

Code

public function testMergeDefaultDefinition() {
  $other_definition = $this
    ->createMock(PluginDefinitionInterface::class);
  $this->sut
    ->expects($this
    ->atLeastOnce())
    ->method('isDefinitionCompatible')
    ->willReturnCallback(function ($value) use ($other_definition) {
    return $value == $other_definition;
  });
  $this
    ->assertSame($this->sut, $this->sut
    ->mergeDefaultDefinition($other_definition));
}