You are here

public function ConfigEntityTypeTest::testConstructBadStorage in Drupal 8

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityTypeTest.php \Drupal\Tests\Core\Config\Entity\ConfigEntityTypeTest::testConstructBadStorage()
  2. 10 core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityTypeTest.php \Drupal\Tests\Core\Config\Entity\ConfigEntityTypeTest::testConstructBadStorage()

@covers ::__construct

File

core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityTypeTest.php, line 101

Class

ConfigEntityTypeTest
@coversDefaultClass \Drupal\Core\Config\Entity\ConfigEntityType @group Config

Namespace

Drupal\Tests\Core\Config\Entity

Code

public function testConstructBadStorage() {
  $this
    ->expectException(ConfigEntityStorageClassException::class);
  $this
    ->expectExceptionMessage('\\Drupal\\Core\\Entity\\KeyValueStore\\KeyValueEntityStorage is not \\Drupal\\Core\\Config\\Entity\\ConfigEntityStorage or it does not extend it');
  new ConfigEntityType([
    'id' => 'example_config_entity_type',
    'handlers' => [
      'storage' => '\\Drupal\\Core\\Entity\\KeyValueStore\\KeyValueEntityStorage',
    ],
  ]);
}