You are here

function ModuleTest::testStatusFunctions in Views (for Drupal 7) 8.3

Tests view enable and disable procedural wrapper functions.

File

lib/Drupal/views/Tests/ModuleTest.php, line 181
Definition of Drupal\views\Tests\ModuleTest.

Class

ModuleTest
Tests basic functions from the Views module.

Namespace

Drupal\views\Tests

Code

function testStatusFunctions() {
  $view = views_get_view('test_view_status')->storage;
  $this
    ->assertFalse($view
    ->isEnabled(), 'The view status is disabled.');
  views_enable_view($view);
  $this
    ->assertTrue($view
    ->isEnabled(), 'A view has been enabled.');
  $this
    ->assertEqual($view
    ->isEnabled(), views_view_is_enabled($view), 'views_view_is_enabled is correct.');
  views_disable_view($view);
  $this
    ->assertFalse($view
    ->isEnabled(), 'A view has been disabled.');
  $this
    ->assertEqual(!$view
    ->isEnabled(), views_view_is_disabled($view), 'views_view_is_disabled is correct.');
}