function UITestBase::drupalGet
Retrieves a Drupal path or an absolute path.
Parameters
\Drupal\Core\Url|string $path: Drupal path or URL to load into internal browser
$options: Options to be forwarded to the url generator.
$headers: An array containing additional HTTP request headers, each formatted as "name: value".
Return value
string The retrieved HTML string, also available as $this->getRawContent()
Overrides WebTestBase::drupalGet
File
- 
              core/modules/ views_ui/ src/ Tests/ UITestBase.php, line 84 
Class
- UITestBase
- Provides a base class for testing the Views UI.
Namespace
Drupal\views_ui\TestsCode
protected function drupalGet($path, array $options = [], array $headers = []) {
  $url = $this->buildUrl($path, $options);
  // Ensure that each nojs page is accessible via ajax as well.
  if (strpos($url, 'nojs') !== FALSE) {
    $url = str_replace('nojs', 'ajax', $url);
    $result = $this->drupalGet($url, $options, $headers);
    $this->assertResponse(200);
    $this->assertHeader('Content-Type', 'application/json');
    $this->assertTrue(json_decode($result), 'Ensure that the AJAX request returned valid content.');
  }
  return parent::drupalGet($path, $options, $headers);
}Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.
