You are here

public function StorageTest::testDetails in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/views_ui/src/Tests/StorageTest.php \Drupal\views_ui\Tests\StorageTest::testDetails()

Tests changing label, description and tag.

See also

views_ui_edit_details_form

File

core/modules/views_ui/src/Tests/StorageTest.php, line 39
Contains \Drupal\views_ui\Tests\StorageTest.

Class

StorageTest
Tests the UI of storage properties of views.

Namespace

Drupal\views_ui\Tests

Code

public function testDetails() {
  $view_name = 'test_view';
  ConfigurableLanguage::createFromLangcode('fr')
    ->save();
  $edit = array(
    'label' => $this
      ->randomMachineName(),
    'tag' => $this
      ->randomMachineName(),
    'description' => $this
      ->randomMachineName(30),
    'langcode' => 'fr',
  );
  $this
    ->drupalPostForm("admin/structure/views/nojs/edit-details/{$view_name}/default", $edit, t('Apply'));
  $this
    ->drupalPostForm(NULL, array(), t('Save'));
  $view = Views::getView($view_name);
  foreach (array(
    'label',
    'tag',
    'description',
    'langcode',
  ) as $property) {
    $this
      ->assertEqual($view->storage
      ->get($property), $edit[$property], format_string('Make sure the property @property got probably saved.', array(
      '@property' => $property,
    )));
  }
}