You are here

public function DraggableviewsTest::testDraggableviewsContent in DraggableViews 8

Same name and namespace in other branches
  1. 2.0.x tests/src/Functional/DraggableviewsTest.php \Drupal\Tests\draggableviews\Functional\DraggableviewsTest::testDraggableviewsContent()

A simple test.

File

tests/src/Functional/DraggableviewsTest.php, line 98

Class

DraggableviewsTest
Tests sortability of Draggableviewws.

Namespace

Drupal\Tests\draggableviews\Functional

Code

public function testDraggableviewsContent() {
  $assert_session = $this
    ->assertSession();
  $this
    ->drupalGet('draggableviews-demo');
  $this
    ->assertSession()
    ->statusCodeEquals(200);

  // Verify that anonymous useres cannot access the order page.
  $this
    ->drupalGet('draggableviews-demo/order');
  $this
    ->assertSession()
    ->statusCodeEquals(403);

  // Verify that authorized user has access to display page.
  $this
    ->drupalLogin($this->adminUser);
  $this
    ->drupalGet('draggableviews-demo');
  $this
    ->assertSession()
    ->statusCodeEquals(200);

  // Verify that the page contains generated content.
  $assert_session
    ->pageTextContains(t('Draggable Content 4'));

  // Verify that authorized user has access to order page.
  $this
    ->drupalGet('draggableviews-demo/order');
  $this
    ->assertSession()
    ->statusCodeEquals(200);

  // Verify that the page contains generated content.
  $assert_session
    ->pageTextContains(t('Draggable Content 5'));
}