function UITestBase::drupalGet

Same name in other branches
  1. 8.9.x core/modules/views_ui/src/Tests/UITestBase.php \Drupal\views_ui\Tests\UITestBase::drupalGet()
  2. 8.9.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. 11.x core/modules/views_ui/tests/src/Functional/UITestBase.php \Drupal\Tests\views_ui\Functional\UITestBase::drupalGet()

Overrides UiHelperTrait::drupalGet

90 calls to UITestBase::drupalGet()
AccessRoleUITest::testAccessRoleUI in core/modules/user/tests/src/Functional/AccessRoleUITest.php
Tests the role access plugin UI.
AnalyzeTest::testAnalyzeBasic in core/modules/views_ui/tests/src/Functional/AnalyzeTest.php
Tests that analyze works in general.
AreaEntityUITest::testUI in core/modules/views_ui/tests/src/Functional/AreaEntityUITest.php
ArgumentValidatorTest::saveArgumentHandlerWithValidationOptions in core/modules/views_ui/tests/src/Functional/ArgumentValidatorTest.php
Saves the test_argument view with changes made to the argument handler.
CachedDataUITest::testCacheData in core/modules/views_ui/tests/src/Functional/CachedDataUITest.php
Tests the shared tempstore views data in the UI.

... 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.