You are here

public function FlippyTest::testPagerOnPage in Flippy 8

Make sure pages appear in article node pages.

File

tests/src/Functional/FlippyTest.php, line 66

Class

FlippyTest
Tests that the Flippy pagers are appearing.

Namespace

Drupal\Tests\flippy\Functional

Code

public function testPagerOnPage() {

  // Load the first page.
  $this
    ->drupalGet('/node/1');

  // Confirm that the site didn't throw a server error or something else.
  $this
    ->assertSession()
    ->statusCodeEquals(200);

  // Confirm that the front page contains the standard text.
  $this
    ->assertNoText('Previous');
  $this
    ->assertText('Next');

  // Load the second page.
  $this
    ->drupalGet('/node/2');

  // Confirm that the site didn't throw a server error or something else.
  $this
    ->assertSession()
    ->statusCodeEquals(200);

  // Confirm that the front page contains the standard text.
  $this
    ->assertText('Previous');
  $this
    ->assertText('Next');

  // Load the last page.
  $this
    ->drupalGet('/node/3');

  // Confirm that the site didn't throw a server error or something else.
  $this
    ->assertSession()
    ->statusCodeEquals(200);

  // Confirm that the front page contains the standard text.
  $this
    ->assertText('Previous');
  $this
    ->assertNoText('Next');
}