You are here

public function FreelinkingPrepopulateTest::testGetConfiguration in Freelinking 4.0.x

Same name and namespace in other branches
  1. 8.3 modules/freelinking_prepopulate/tests/src/Unit/Plugin/freelinking/FreelinkingPrepopulateTest.php \Drupal\Tests\freelinking_prepopulate\Unit\Plugin\freelinking\FreelinkingPrepopulateTest::testGetConfiguration()

Asserts that the configuration is returned based on initial state.

@dataProvider configurationProvider

Parameters

array $configuration: The initial plugin configuration.

array $expected: The expected return value.

File

modules/freelinking_prepopulate/tests/src/Unit/Plugin/freelinking/FreelinkingPrepopulateTest.php, line 63

Class

FreelinkingPrepopulateTest
Tests FreelinkingPrepopulate freelinking plugin.

Namespace

Drupal\Tests\freelinking_prepopulate\Unit\Plugin\freelinking

Code

public function testGetConfiguration(array $configuration, array $expected) {
  $definition = [
    'id' => 'freelinking_prepopulate',
    'title' => 'Prepopulate',
    'settings' => [
      'default_node_type' => 'page',
      'advanced' => [
        'title' => '0',
      ],
      'failover' => 'search',
    ],
  ];
  $plugin = FreelinkingPrepopulate::create(\Drupal::getContainer(), $configuration, 'freelinking_prepopulate', $definition);
  $this
    ->assertEquals($expected, $plugin
    ->getConfiguration());
}