public function UITestBase::randomView in Zircon Profile 8.0
Same name and namespace in other branches
- 8 core/modules/views_ui/src/Tests/UITestBase.php \Drupal\views_ui\Tests\UITestBase::randomView()
A helper method which creates a random view.
10 calls to UITestBase::randomView()
- AreaEntityUITest::testUI in core/
modules/ views_ui/ src/ Tests/ AreaEntityUITest.php - DisplayCRUDTest::testAddDisplay in core/
modules/ views_ui/ src/ Tests/ DisplayCRUDTest.php - Tests adding a display.
- DisplayCRUDTest::testDuplicateDisplay in core/
modules/ views_ui/ src/ Tests/ DisplayCRUDTest.php - Tests the duplicating of a display.
- DisplayCRUDTest::testRemoveDisplay in core/
modules/ views_ui/ src/ Tests/ DisplayCRUDTest.php - Tests removing a display.
- DisplayTest::testAddDisplay in core/
modules/ views_ui/ src/ Tests/ DisplayTest.php - Tests adding a display.
File
- core/
modules/ views_ui/ src/ Tests/ UITestBase.php, line 61 - Contains \Drupal\views_ui\Tests\UITestBase.
Class
- UITestBase
- Provides a base class for testing the Views UI.
Namespace
Drupal\views_ui\TestsCode
public function randomView(array $view = array()) {
// Create a new view in the UI.
$default = array();
$default['label'] = $this
->randomMachineName(16);
$default['id'] = strtolower($this
->randomMachineName(16));
$default['description'] = $this
->randomMachineName(16);
$default['page[create]'] = TRUE;
$default['page[path]'] = $default['id'];
$view += $default;
$this
->drupalPostForm('admin/structure/views/add', $view, t('Save and edit'));
return $default;
}