You are here

public function ContactSubmissionTest::dataContactValues in Webform CiviCRM Integration 8.5

Data for the test.

Each test returns the Contact type and array of contact values.

It is setup that there is one contact, but there may be multiple values for email, website, etc.

@todo determine what "type" each email could be.

contact_values: contact: first_name: foo last_name: bar nickname: baz email:

website:

Return value

\Generator The test data.

File

tests/src/FunctionalJavascript/ContactSubmissionTest.php, line 476

Class

ContactSubmissionTest
Tests submitting a Webform with CiviCRM and a single contact.

Namespace

Drupal\Tests\webform_civicrm\FunctionalJavascript

Code

public function dataContactValues() {
  (yield [
    'Individual',
    [
      'contact' => [
        'first_name' => 'Frederick',
        'last_name' => 'Pabst',
      ],
    ],
  ]);
  (yield [
    'Individual',
    [
      'contact' => [
        'first_name' => 'Frederick',
        'last_name' => 'Pabst',
      ],
      'email' => [
        [
          'email' => 'fred@example.com',
        ],
      ],
      'address' => [
        [
          'street_address' => 'Test',
          'city' => 'Adamsville',
          'postal_code' => '35005',
          'country_id' => '1228',
          'state_province_id' => 'AL',
          'county_id' => '7',
        ],
      ],
    ],
  ]);
  (yield [
    'Individual',
    [
      'contact' => [
        'first_name' => 'Frederick',
        'last_name' => 'Pabst',
      ],
      'website' => [
        [
          'url' => 'https://example.com',
        ],
      ],
    ],
  ]);
  (yield [
    'Individual',
    [
      'contact' => [
        'first_name' => 'Frederick',
        'last_name' => 'Pabst',
      ],
      'phone' => [
        [
          'phone' => '555-555-5555',
        ],
      ],
    ],
  ]);
  (yield [
    'Individual',
    [
      'contact' => [
        'first_name' => 'Frederick',
        'last_name' => 'Pabst',
      ],
      'email' => [
        [
          'email' => 'fred@example.com',
        ],
      ],
      'website' => [
        [
          'url' => 'https://example.com',
        ],
      ],
      'phone' => [
        [
          'phone' => '555-555-5555',
        ],
      ],
    ],
  ]);
}