You are here

protected function WebformMigrateAssertionsTrait::assertWebform3Values 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::assertWebform3Values()

Assertions of the webform_3 configuration entity.

1 call to WebformMigrateAssertionsTrait::assertWebform3Values()
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 38

Class

WebformMigrateAssertionsTrait
Trait for webform migration tests.

Namespace

Drupal\Tests\webform_migrate\Traits

Code

protected function assertWebform3Values() {
  $webform = $this->container
    ->get('entity_type.manager')
    ->getStorage('webform')
    ->load('webform_3');
  assert($webform instanceof WebformInterface);
  $this
    ->assertEquals([
    'uid' => 2,
    'status' => 'open',
    'langcode' => 'en',
    'dependencies' => [],
    'open' => NULL,
    'close' => NULL,
    'weight' => 0,
    'template' => FALSE,
    'archive' => FALSE,
    'id' => 'webform_3',
    'title' => 'A Webform host node with "webform_custom" type',
    'description' => NULL,
    'category' => NULL,
    'elements' => "first_page:\n  '#type': webform_wizard_page\n  '#title': Start\n  title_as_textfield:\n    '#type': textfield\n    '#size': 100\n    '#title': 'Title (as textfield)'\n    '#description': \"Required, no default value, no conditions.\\nIf the title contains <code>fieldset</code>, then a fieldset will appear.\"\n    '#required': true\n  date:\n    '#type': date\n    '#title': 'Date'\n    '#description': \"Optional, no default value, website timezone.\"\n  email:\n    '#type': email\n    '#size': 20\n    '#default_value': '[current-user:mail]'\n    '#title_display': invisible\n    '#title': 'E-mail'\n    '#description': \"No label; user email as default; long format ('Example Name' <name@example.com>) can be used.\"\n  file_attachment:\n    '#type': managed_file\n    '#max_filesize': '2'\n    '#file_extensions': 'gif jpg jpeg png eps txt rtf html pdf doc docx odt ppt pptx odp xls xlsx ods xml ps'\n    '#title': 'File attachment'\n    '#description': \"\"\n  fieldset:\n    '#type': fieldset\n    '#open': true\n    '#title': 'Fieldset'\n    '#description': \"\"\n    '#states':\n      visible:\n        ':input[name=\"title_as_textfield\"]':\n          value:\n            pattern: fieldset\n    hidden_value_5:\n      '#type': hidden\n      '#default_value': 'hidden value of \"hidden_value\"'\n      '#title': 'Hidden value'\n      '#description': \"\"\n    select_multi_nested_5:\n      '#type': select\n      '#options':\n        a: 'Option A'\n        b: 'Option B'\n        'Group A':\n          aa: 'Option AA'\n          ab: 'Option AB'\n        'Group B':\n          ba: 'Option BA'\n          bb: 'Option BB'\n        c: 'Option C'\n      '#multiple': true\n      '#title': 'Select options (multiple, nested)'\n      '#description': \"\"\n  text_markup:\n    '#type': processed_text\n    '#format': full_html\n    '#text': \"Some <strong>text</strong> with <code>filtered_html</code>, displayed only on the form.\"\n    '#title': 'Text markup'\n    '#description': \"\"\n  number:\n    '#type': textfield\n    '#size': 20\n    '#min': 10\n    '#max': 3000\n    '#unique': false\n    '#title': 'Number'\n    '#description': \"An integer between 10 and 3000.\"\n    '#required': true\n  radios:\n    '#type': radios\n    '#options':\n      tuesday: 'Tuesday'\n      wednesday: 'Wednesday'\n      thursday: 'Thursday'\n      friday: 'Friday'\n      saturday: 'Saturday'\n      sunday: 'Sunday'\n    '#default_value': 'wednesday'\n    '#title': 'Radios'\n    '#description': \"Select the best day of the week\"\n    '#required': true\npage_break:\n  '#type': webform_wizard_page\n  '#title': Page break\n  checkboxes:\n    '#type': checkboxes\n    '#options':\n      AF: 'Afghanistan'\n      AX: 'Aland Islands'\n      AL: 'Albania'\n      DZ: 'Algeria'\n      AS: 'American Samoa'\n      AD: 'Andorra'\n      AO: 'Angola'\n      AI: 'Anguilla'\n      AQ: 'Antarctica'\n      AG: 'Antigua and Barbuda'\n      AR: 'Argentina'\n      AM: 'Armenia'\n      AW: 'Aruba'\n      AU: 'Australia'\n      AT: 'Austria'\n      AZ: 'Azerbaijan'\n      ZM: 'Zambia'\n      ZW: 'Zimbabwe'\n    '#multiple': true\n    '#title': 'Checkboxes'\n    '#description': \"Countries you want to travel to (only A and Z)\"\n  textarea:\n    '#type': textarea\n    '#title': 'Textarea'\n    '#description': \"\"\n  time:\n    '#type': webform_time\n    '#time_format': 'H:i'\n    '#step': 60\n    '#title_display': inline\n    '#title': 'Time'\n    '#description': \"\"\n",
    'css' => '',
    'javascript' => '',
    'settings' => [
      'page' => TRUE,
      'page_submit_path' => '',
      'page_confirm_path' => '',
      'wizard_progress_bar' => TRUE,
      'preview' => 0,
      'draft' => '0',
      'draft_auto_save' => FALSE,
      'confirmation_type' => 'page',
      'confirmation_url' => '',
      'confirmation_message' => '',
      'limit_total' => NULL,
      'limit_user' => NULL,
    ],
    'access' => [
      'create' => [
        'roles' => [
          'anonymous',
          'authenticated',
        ],
        'users' => [],
      ],
    ],
    'handlers' => [],
    'variants' => [],
  ], $this
    ->getImportantEntityProperties($webform));
}