diff --git a/src/Controller/ListPageRssController.php b/src/Controller/ListPageRssController.php index 7318cb65..f8ba97cc 100644 --- a/src/Controller/ListPageRssController.php +++ b/src/Controller/ListPageRssController.php @@ -249,7 +249,7 @@ protected function getItemList(NodeInterface $node, CacheableMetadata $cache_met 'direction' => 'DESC', ]); // Always limit the rss to the last 25 results. - $configuration->setLimit(25); + $configuration->setLimit(30); // Always use the first page to calculate the offset. $configuration->setPage(0); $execution_result = $this->listExecutionManager->executeList($configuration); diff --git a/tests/src/FunctionalJavascript/ListPageRssControllerTest.php b/tests/src/FunctionalJavascript/ListPageRssControllerTest.php index ece803ca..616459e9 100644 --- a/tests/src/FunctionalJavascript/ListPageRssControllerTest.php +++ b/tests/src/FunctionalJavascript/ListPageRssControllerTest.php @@ -115,7 +115,7 @@ public function testListPageRssPage(): void { $node = Node::create($values); $node->save(); - for ($i = 1; $i <= 25; $i++) { + for ($i = 1; $i <= 30; $i++) { $earlier_date->modify('-1 day'); $values = [ 'title' => 'test node ' . $i, @@ -200,8 +200,8 @@ public function testListPageRssPage(): void { // Assert contents of items. $items = $channel->filterXPath('//item'); - // Assert only the first 25 items are shown. - $this->assertEquals(25, $items->count()); + // Assert only the first 30 items are shown (32 in total). + $this->assertEquals(30, $items->count()); $first_item = $items->eq(0); $this->assertEquals('that yellow fruit', $first_item->filterXpath('//title')->text()); $this->assertEquals('<p>this is a banana</p> ', $first_item->filterXpath('//description')->html()); @@ -224,8 +224,8 @@ public function testListPageRssPage(): void { // Assert the last item title to make sure we order // and limit the list correctly. - $last_item = $items->eq(24); - $this->assertEquals('test node 23', $last_item->filterXpath('//title')->text()); + $last_item = $items->eq(29); + $this->assertEquals('test node 28', $last_item->filterXpath('//title')->text()); // Assert that even if we pass pager options these are ignored. $this->drupalGet(Url::fromRoute('entity.node.list_page_rss', ['node' => $node->id()], ['query' => ['page' => '1']])); @@ -234,12 +234,12 @@ public function testListPageRssPage(): void { $channel = $crawler->filterXPath('//rss[@version=2.0]/channel'); // Assert contents of items. $items = $channel->filterXPath('//item'); - // Assert only the first 25 items are shown. - $this->assertEquals(25, $items->count()); + // Assert only the first 30 items are shown (32 in total). + $this->assertEquals(30, $items->count()); $first_item = $items->eq(0); $this->assertEquals('that yellow fruit', $first_item->filterXpath('//title')->text()); - $last_item = $items->eq(24); - $this->assertEquals('test node 23', $last_item->filterXpath('//title')->text()); + $last_item = $items->eq(29); + $this->assertEquals('test node 28', $last_item->filterXpath('//title')->text()); // Change the node title and assert the response has changed. $node->set('title', 'List page test updated');