You are here

public function OptimizelyTestPageSnippetTestCase::testOptimizelyTestPageSnippetTestForPresenceWildcard in Optimizely 7.3

Same name and namespace in other branches
  1. 7.2 optimizely.test \OptimizelyTestPageSnippetTestCase::testOptimizelyTestPageSnippetTestForPresenceWildcard()

File

./optimizely.test, line 605
Optimizely Tests

Class

OptimizelyTestPageSnippetTestCase

Code

public function testOptimizelyTestPageSnippetTestForPresenceWildcard() {

  // Access with privileged user
  $this
    ->drupalLogin($this->anonymous_user);

  // @todo: Test Project is enabled
  for ($project_count = 0; $project_count <= 3; $project_count++) {
    $paths = explode("\n", $this->project_paths[$project_count]);
    foreach ($paths as $path) {

      // End test if path value is invalid
      if ($path == '') {
        break;
      }

      // Wildcard found
      if (strpos($path, '/*') !== FALSE) {

        // @todo: Lookup all page paths that match wildcard
        // Go to paths that match wildcard project entry
        $this
          ->drupalGet($path);

        // Confirm Optimizely snippet is found at page that matches wildcard path
        // $this->assertRaw('<script type="text/javascript" src="http://cdn.optimizely.com/js/' . $this->project_code . '.js"></script>', '** <strong>Optimizely snippet call http://cdn.optimizely.com/js/' . $this->project_code . '.js found</strong> at: ' . $path . ' wildcard path.');
      }
    }
  }
}