You are here

function ViewsViewTest::testDelete in Views (for Drupal 7) 7.3

Test deleting a view.

File

tests/views_view.test, line 74
Views class tests.

Class

ViewsViewTest

Code

function testDelete() {

  // Delete a database view.
  $view = $this
    ->view_test_delete();
  $view
    ->save();
  $view = views_get_view($view->name);
  $view
    ->delete();
  $view = views_get_view($view->name);
  $this
    ->assertNotNull($view, 'Make sure that the old view is still in the static cache.');
  $view = views_get_view($view->name, TRUE);
  $this
    ->assertNull($view, "Make sure that the old view gets cleared by the reset parameter.");
}