You are here

public function DefaultTableMappingTest::testGetFieldTableNameInvalid in Drupal 9

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Core/Entity/Sql/DefaultTableMappingTest.php \Drupal\Tests\Core\Entity\Sql\DefaultTableMappingTest::testGetFieldTableNameInvalid()

Tests DefaultTableMapping::getFieldTableName() with an invalid parameter.

@covers ::getFieldTableName

File

core/tests/Drupal/Tests/Core/Entity/Sql/DefaultTableMappingTest.php, line 442

Class

DefaultTableMappingTest
@coversDefaultClass \Drupal\Core\Entity\Sql\DefaultTableMapping @group Entity

Namespace

Drupal\Tests\Core\Entity\Sql

Code

public function testGetFieldTableNameInvalid() {
  $table_mapping = new TestDefaultTableMapping($this->entityType, []);
  $this
    ->expectException(SqlContentEntityStorageException::class);
  $this
    ->expectExceptionMessage("Table information not available for the 'invalid_field_name' field.");
  $table_mapping
    ->getFieldTableName('invalid_field_name');
}