You are here

protected function WebformMigrateAssertionsTrait::assertWebformSubmission9Values in Webform: Migrate 8.2

Same name and namespace in other branches
  1. 8 tests/src/Traits/WebformMigrateAssertionsTrait.php \Drupal\Tests\webform_migrate\Traits\WebformMigrateAssertionsTrait::assertWebformSubmission9Values()

Assertions of the webform_submission 9 content entity.

1 call to WebformMigrateAssertionsTrait::assertWebformSubmission9Values()
WebformMigrateTest::testWebformMigrations in tests/src/Kernel/Migrate/d7/WebformMigrateTest.php
Tests the migration of webforms and webform submissions.

File

tests/src/Traits/WebformMigrateAssertionsTrait.php, line 737

Class

WebformMigrateAssertionsTrait
Trait for webform migration tests.

Namespace

Drupal\Tests\webform_migrate\Traits

Code

protected function assertWebformSubmission9Values() {
  $webform_submission = $this->container
    ->get('entity_type.manager')
    ->getStorage('webform_submission')
    ->load(9);
  assert($webform_submission instanceof WebformSubmissionInterface);
  $this
    ->assertEquals([
    'uid' => [
      [
        'target_id' => 2,
      ],
    ],
    'created' => [
      [
        'value' => 1600328929,
      ],
    ],
    'serial' => [
      [
        'value' => 4,
      ],
    ],
    'sid' => [
      [
        'value' => 9,
      ],
    ],
    'uri' => [
      [
        'value' => '/node/4',
      ],
    ],
    'completed' => [
      [
        'value' => 1600328929,
      ],
    ],
    'in_draft' => [
      [
        'value' => 0,
      ],
    ],
    'current_page' => [],
    'remote_addr' => [
      [
        'value' => '127.0.0.1',
      ],
    ],
    'webform_id' => [
      [
        'target_id' => 'webform_4',
      ],
    ],
    'entity_type' => [
      [
        'value' => 'node',
      ],
    ],
    'entity_id' => [
      [
        'value' => 4,
      ],
    ],
    'locked' => [
      [
        'value' => 0,
      ],
    ],
    'sticky' => [
      [
        'value' => 0,
      ],
    ],
    'notes' => [],
  ], $this
    ->getImportantEntityProperties($webform_submission));

  // Webform submission data.
  $this
    ->assertEquals([
    'grid' => [
      'd7_sitebuild' => 'easy',
      'd7_theming' => 'easy',
      'd7_backend' => 'neutral',
      'd9_sitebuild' => 'easy',
      'd9_theming' => 'easy',
      'd9_backend' => 'easy',
    ],
  ], $webform_submission
    ->getData());
}