You are here

public function EntityReferenceSelectionUnitTest::testInvalidDefaultConfiguration in Drupal 8

Tests invalid default configuration.

@covers ::defaultConfiguration @covers ::resolveBackwardCompatibilityConfiguration

File

core/tests/Drupal/Tests/Core/EntityReferenceSelection/EntityReferenceSelectionUnitTest.php, line 24

Class

EntityReferenceSelectionUnitTest
Provides unit testing for selection handlers.

Namespace

Drupal\Tests\Core\EntityReferenceSelection

Code

public function testInvalidDefaultConfiguration() {
  $this
    ->expectException(\InvalidArgumentException::class);
  $this
    ->expectExceptionMessage("TestSelectionWithInvalidDefaultConfiguration::defaultConfiguration() should not contain a 'handler_settings' key. All settings should be placed in the root level.");
  new TestSelectionWithInvalidDefaultConfiguration([], 'test_selector', [
    'class' => 'TestSelectionWithInvalidDefaultConfiguration',
  ]);
}