You are here

protected function UITestBase::drupalGet in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/views_ui/src/Tests/UITestBase.php \Drupal\views_ui\Tests\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

52 calls to UITestBase::drupalGet()
AreaEntityUITest::testUI in core/modules/views_ui/src/Tests/AreaEntityUITest.php
CachedDataUITest::testCacheData in core/modules/views_ui/src/Tests/CachedDataUITest.php
Tests the user tempstore views data in the UI.
ConfigTranslationViewListUiTest::testTranslateOperationInViewListUi in core/modules/config_translation/src/Tests/ConfigTranslationViewListUiTest.php
Tests views_ui list to see if translate link is added to operations.
ContentTranslationViewsUITest::testViewsUI in core/modules/content_translation/src/Tests/Views/ContentTranslationViewsUITest.php
Tests the views UI.
DefaultViewsTest::testDefaultViews in core/modules/views_ui/src/Tests/DefaultViewsTest.php
Tests default views.

... See full list

File

core/modules/views_ui/src/Tests/UITestBase.php, line 80
Contains \Drupal\views_ui\Tests\UITestBase.

Class

UITestBase
Provides a base class for testing the Views UI.

Namespace

Drupal\views_ui\Tests

Code

protected function drupalGet($path, array $options = array(), array $headers = array()) {
  $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);
}