You are here

public function PathContextTest::providerTestGetIdentity in Acquia Lift Connector 8

Data provider for testGetIdentity().

File

tests/src/Unit/Service/Context/PathContextTest.php, line 215
Contains \Drupal\Tests\acquia_lift\Service\Context\PathContextTest.

Class

PathContextTest
PathContextTest Test.

Namespace

Drupal\Tests\acquia_lift\Service\Context

Code

public function providerTestGetIdentity() {
  $no_query_parameter_string = '';
  $full_query_parameter_string = 'my_identity_parameter=query_identity&my_identity_type_parameter=query_identity_type&other=other';
  $partial_query_parameter_string = 'my_identity_parameter=query_identity&other=other';
  $no_capture_identity = FALSE;
  $do_capture_identity = TRUE;
  $no_set_user = FALSE;
  $do_set_user = TRUE;
  $expect_identity_empty = NULL;
  $expect_identity_of_full_query_string = [
    'identity' => 'query_identity',
    'identityType' => 'query_identity_type',
  ];
  $expect_identity_of_partial_query_string = [
    'identity' => 'query_identity',
    'identityType' => 'my_default_identity_type',
  ];
  $expect_identity_of_user = [
    'identity' => 'a_user_email',
    'identityType' => 'email',
  ];
  $data['no query, no capture, no user'] = [
    $no_query_parameter_string,
    $no_capture_identity,
    $no_set_user,
    $expect_identity_empty,
  ];
  $data['no query, no capture, yes user'] = [
    $no_query_parameter_string,
    $no_capture_identity,
    $do_set_user,
    $expect_identity_empty,
  ];
  $data['no query, do capture, yes user'] = [
    $no_query_parameter_string,
    $do_capture_identity,
    $do_set_user,
    $expect_identity_of_user,
  ];
  $data['yes query, no capture, no user'] = [
    $full_query_parameter_string,
    $no_capture_identity,
    $no_set_user,
    $expect_identity_of_full_query_string,
  ];
  $data['yes query (but partial), no capture, no user'] = [
    $partial_query_parameter_string,
    $no_capture_identity,
    $no_set_user,
    $expect_identity_of_partial_query_string,
  ];
  $data['yes query, no capture, yes user'] = [
    $full_query_parameter_string,
    $no_capture_identity,
    $do_set_user,
    $expect_identity_of_full_query_string,
  ];
  $data['yes query, do capture, yes user'] = [
    $full_query_parameter_string,
    $do_capture_identity,
    $do_set_user,
    $expect_identity_of_user,
  ];
  return $data;
}