You are here

public function UtilsTest::testWfCrmExplodeKey in Webform CiviCRM Integration 8.5

File

tests/src/Unit/UtilsTest.php, line 14

Class

UtilsTest
@group webform_civicrm

Namespace

Drupal\Tests\webform_civicrm\Unit

Code

public function testWfCrmExplodeKey() {
  $utils = new Utils();
  $container = new ContainerBuilder();
  \Drupal::setContainer($container);
  $container
    ->set('webform_civicrm.utils', $utils);
  $utils = \Drupal::service('webform_civicrm.utils');
  $this
    ->assertNull($utils
    ->wf_crm_explode_key('not_even_remotely_valid'));
  $this
    ->assertEquals([
    'civicrm',
    '1',
    'contact',
    '1',
    'email',
    'email',
  ], $utils
    ->wf_crm_explode_key('civicrm_1_contact_1_email_email'));
}