You are here

public function ContactStorageFieldTest::testContactIdFieldIsCreated in Contact Storage 8

Covers contact_storage_install().

File

tests/src/Kernel/ContactStorageFieldTest.php, line 30

Class

ContactStorageFieldTest
Tests contact_storage ID field.

Namespace

Drupal\Tests\contact_storage\Kernel

Code

public function testContactIdFieldIsCreated() {
  $this->container
    ->get('module_installer')
    ->install([
    'contact_storage',
  ]);

  // There should be no updates as contact_storage_install() should have
  // applied the new field.
  $this
    ->assertTrue(empty($this->container
    ->get('entity.definition_update_manager')
    ->needsUpdates()['contact_message']));
  $this
    ->assertTrue(!empty($this->container
    ->get('entity_field.manager')
    ->getFieldStorageDefinitions('contact_message')['id']));
}