function UITestBase::drupalGet

Same name and namespace in other branches
  1. 8.9.x core/modules/views_ui/src/Tests/UITestBase.php \Drupal\views_ui\Tests\UITestBase::drupalGet()
  2. 11.x core/modules/views_ui/tests/src/Functional/UITestBase.php \Drupal\Tests\views_ui\Functional\UITestBase::drupalGet()
  3. 10 core/modules/views_ui/tests/src/Functional/UITestBase.php \Drupal\Tests\views_ui\Functional\UITestBase::drupalGet()
  4. 8.9.x core/modules/views_ui/tests/src/Functional/UITestBase.php \Drupal\Tests\views_ui\Functional\UITestBase::drupalGet()
6 calls to UITestBase::drupalGet()
AreaEntityUITest::testUI in core/modules/views_ui/tests/src/Functional/AreaEntityUITest.php
HandlerTest::testBrokenHandlers in core/modules/views_ui/tests/src/Functional/HandlerTest.php
Tests broken handlers.
HandlerTest::testErrorMissingHelp in core/modules/views_ui/tests/src/Functional/HandlerTest.php
Ensures that no missing help text is shown.
HandlerTest::testHandlerHelpEscaping in core/modules/views_ui/tests/src/Functional/HandlerTest.php
Tests escaping of field labels in help text.
HandlerTest::testNoDuplicateFields in core/modules/views_ui/tests/src/Functional/HandlerTest.php
Ensures that neither node type or node ID appears multiple times.

... See full list

File

core/modules/views_ui/tests/src/Functional/UITestBase.php, line 76

Class

UITestBase
Provides a base class for testing the Views UI.

Namespace

Drupal\Tests\views_ui\Functional

Code

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 = preg_replace('|/nojs/|', '/ajax/', $url, 1);
    $result = $this->drupalGet($url, $options);
    $this->assertSession()
      ->statusCodeEquals(200);
    $this->assertSession()
      ->responseHeaderEquals('Content-Type', 'application/json');
    $this->assertNotEmpty(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.