function UITestBase::drupalGet

Same name and namespace in other branches
  1. 11.x core/modules/views_ui/tests/src/Functional/UITestBase.php \Drupal\Tests\views_ui\Functional\UITestBase::drupalGet()
4 calls to UITestBase::drupalGet()
ConfigTranslationViewListUiTest::testTimestampFormatterTranslation in core/modules/config_translation/tests/src/Functional/ConfigTranslationViewListUiTest.php
Test to ensure that TimestampFormatter translation works.
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.
RearrangeFieldsTest::assertFieldOrder in core/modules/views_ui/tests/src/Functional/RearrangeFieldsTest.php
Check if the fields are in the correct order.
RearrangeFieldsTest::testRearrangeFields in core/modules/views_ui/tests/src/Functional/RearrangeFieldsTest.php
Tests field sorting.

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.