public function StorageTest::testDetails

Tests changing label, description and tag.

See also

views_ui_edit_details_form

File

drupal/core/modules/views_ui/lib/Drupal/views_ui/Tests/StorageTest.php, line 44
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';
  $language = new Language(array(
    'name' => 'French',
    'langcode' => 'fr',
  ));
  language_save($language);
  $edit = array(
    'label' => $this
      ->randomName(),
    'tag' => $this
      ->randomName(),
    'description' => $this
      ->randomName(30),
    'langcode' => 'fr',
  );
  $this
    ->drupalPost("admin/structure/views/nojs/edit-details/{$view_name}/default", $edit, t('Apply'));
  $this
    ->drupalPost(NULL, array(), t('Save'));
  $view = views_get_view($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,
    )));
  }
}