function UITestBase::drupalGet

Same name in this branch
  1. 8.9.x core/modules/views_ui/src/Tests/UITestBase.php \Drupal\views_ui\Tests\UITestBase::drupalGet()
Same name in other branches
  1. 9 core/modules/views_ui/tests/src/Functional/UITestBase.php \Drupal\Tests\views_ui\Functional\UITestBase::drupalGet()
  2. 10 core/modules/views_ui/tests/src/Functional/UITestBase.php \Drupal\Tests\views_ui\Functional\UITestBase::drupalGet()
  3. 11.x core/modules/views_ui/tests/src/Functional/UITestBase.php \Drupal\Tests\views_ui\Functional\UITestBase::drupalGet()

Overrides UiHelperTrait::drupalGet

66 calls to UITestBase::drupalGet()
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
CachedDataUITest::testCacheData in core/modules/views_ui/tests/src/Functional/CachedDataUITest.php
Tests the shared tempstore views data in the UI.
ConfigTranslationViewListUiTest::testTranslateOperationInViewListUi in core/modules/config_translation/tests/src/Functional/ConfigTranslationViewListUiTest.php
Tests views_ui list to see if translate link is added to operations.
ContentTranslationViewsUITest::testViewsUI in core/modules/content_translation/tests/src/Functional/Views/ContentTranslationViewsUITest.php
Tests the views UI.

... See full list

File

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

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->assertEquals('application/json', $this->getSession()
            ->getResponseHeader('Content-Type'));
        $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.