You are here

protected function MigrateContactCategoryTest::assertEntity in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/contact/tests/src/Kernel/Migrate/MigrateContactCategoryTest.php \Drupal\Tests\contact\Kernel\Migrate\MigrateContactCategoryTest::assertEntity()

Performs various assertions on a single contact form entity.

Parameters

string $id: The contact form ID.

string $expected_label: The expected label.

string[] $expected_recipients: The recipient e-mail addresses the form should have.

string $expected_reply: The expected reply message.

int $expected_weight: The contact form's expected weight.

1 call to MigrateContactCategoryTest::assertEntity()
MigrateContactCategoryTest::testContactCategory in core/modules/contact/tests/src/Kernel/Migrate/MigrateContactCategoryTest.php
The Drupal 6 and 7 contact categories to Drupal 8 migration.

File

core/modules/contact/tests/src/Kernel/Migrate/MigrateContactCategoryTest.php, line 45

Class

MigrateContactCategoryTest
Migrate contact categories to contact.form.*.yml.

Namespace

Drupal\Tests\contact\Kernel\Migrate

Code

protected function assertEntity($id, $expected_label, array $expected_recipients, $expected_reply, $expected_weight) {

  /** @var \Drupal\contact\ContactFormInterface $entity */
  $entity = ContactForm::load($id);
  $this
    ->assertInstanceOf(ContactFormInterface::class, $entity);
  $this
    ->assertIdentical($expected_label, $entity
    ->label());
  $this
    ->assertIdentical($expected_recipients, $entity
    ->getRecipients());
  $this
    ->assertIdentical($expected_reply, $entity
    ->getReply());
  $this
    ->assertIdentical($expected_weight, $entity
    ->getWeight());
}