You are here

private function AcquiaLiftsWebTest::assertLiftIdentityMetaTag in Acquia Lift Connector 7.3

Helper function to assert that an identifier meta tag is found in the page

1 call to AcquiaLiftsWebTest::assertLiftIdentityMetaTag()
AcquiaLiftsWebTest::testIdentityParams in tests/acquia_lift.test
Tests identity param configuration and js settings.

File

tests/acquia_lift.test, line 553
Tests for Acquia Lift Profiles module.

Class

AcquiaLiftsWebTest
Tests Acquia Lift functionality.

Code

private function assertLiftIdentityMetaTag($type = NULL, $value = NULL) {
  if ($type) {
    $pattern = '/<meta (?=[^>]*itemprop="acquia_lift:identity:' . preg_quote($type, '/') . '")';
    if (!empty($value)) {
      $pattern .= '(?=[^>]*content="' . preg_quote($value, '/') . '")';
    }
    $pattern .= '/';
  }
  else {
    $pattern = '/<meta (?=[^>]*itemprop="acquia_lift:identity:)/';
  }
  $this
    ->assertPattern($pattern, 'Found identity meta tag' . $type ? ' for ' . $type : '');
}