function DisplayTest::testAddDisplay

Same name in this branch
  1. 8.9.x core/modules/views_ui/tests/src/FunctionalJavascript/DisplayTest.php \Drupal\Tests\views_ui\FunctionalJavascript\DisplayTest::testAddDisplay()
Same name in other branches
  1. 9 core/modules/views_ui/tests/src/FunctionalJavascript/DisplayTest.php \Drupal\Tests\views_ui\FunctionalJavascript\DisplayTest::testAddDisplay()
  2. 9 core/modules/views_ui/tests/src/Functional/DisplayTest.php \Drupal\Tests\views_ui\Functional\DisplayTest::testAddDisplay()
  3. 10 core/modules/views_ui/tests/src/FunctionalJavascript/DisplayTest.php \Drupal\Tests\views_ui\FunctionalJavascript\DisplayTest::testAddDisplay()
  4. 10 core/modules/views_ui/tests/src/Functional/DisplayTest.php \Drupal\Tests\views_ui\Functional\DisplayTest::testAddDisplay()
  5. 11.x core/modules/views_ui/tests/src/FunctionalJavascript/DisplayTest.php \Drupal\Tests\views_ui\FunctionalJavascript\DisplayTest::testAddDisplay()
  6. 11.x core/modules/views_ui/tests/src/Functional/DisplayTest.php \Drupal\Tests\views_ui\Functional\DisplayTest::testAddDisplay()

Tests adding a display.

File

core/modules/views_ui/tests/src/Functional/DisplayTest.php, line 38

Class

DisplayTest
Tests the display UI.

Namespace

Drupal\Tests\views_ui\Functional

Code

public function testAddDisplay() {
    $view = $this->randomView();
    $this->assertNoText('Block');
    $this->assertNoText('Block 2');
    $this->drupalPostForm(NULL, [], t('Add @display', [
        '@display' => 'Block',
    ]));
    $this->assertText('Block');
    $this->assertNoText('Block 2');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.