public function EntityReferenceSelectionUnitTest::testSetConfiguration in Drupal 8
Tests selection handler plugin configuration set.
@dataProvider providerTestSetConfiguration @covers ::setConfiguration @covers ::resolveBackwardCompatibilityConfiguration @covers ::ensureBackwardCompatibilityConfiguration
Parameters
array $options: The configuration passed to the plugin.
File
- core/
tests/ Drupal/ Tests/ Core/ EntityReferenceSelection/ EntityReferenceSelectionUnitTest.php, line 118
Class
- EntityReferenceSelectionUnitTest
- Provides unit testing for selection handlers.
Namespace
Drupal\Tests\Core\EntityReferenceSelectionCode
public function testSetConfiguration($options) {
$selection = new TestSelection($options, 'test_selector', []);
$expected = [
'target_type' => NULL,
'handler' => 'test_selector',
'entity' => NULL,
'setting1' => 'foo',
'setting2' => [
'qux' => 'qux value',
'bar' => 'bar value',
'baz' => 'baz value',
],
'setting3' => 'foobar',
'handler_settings' => [
'setting1' => 'foo',
'setting2' => [
'qux' => 'qux value',
'bar' => 'bar value',
'baz' => 'baz value',
],
'setting3' => 'foobar',
],
];
$this
->assertArrayEquals($expected, $selection
->getConfiguration());
}