You are here

public function DisplayJsonFeedTest::testFeedLastPage in JSON Feed 8

Test last page of feed items.

File

tests/src/Functional/DisplayJsonFeedTest.php, line 191

Class

DisplayJsonFeedTest
Tests the json_feed display plugin.

Namespace

Drupal\Tests\json_feed\Functional

Code

public function testFeedLastPage() {
  $feed_content = $this
    ->getFeedLastPage();
  $this
    ->assertFalse(array_key_exists('next_url', $feed_content), 'JSON Feed next_url attribute not present on last page.');
  $expectedLastPageItemsCount = $this->nodesToCreate % $this->feedItemsPerPage;
  $this
    ->assertEqual($expectedLastPageItemsCount, count($feed_content['items']), 'JSON Feed last page returned ' . $expectedLastPageItemsCount . ' items.');
}