Skip to content

Commit

Permalink
Merge pull request #191 from openeuropa/EWPP-3533
Browse files Browse the repository at this point in the history
EWPP-3533: Increase RSS limit to 30 items.
  • Loading branch information
upchuk authored Sep 6, 2023
2 parents 09f4ea3 + a06afbc commit b43ed24
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/Controller/ListPageRssController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
18 changes: 9 additions & 9 deletions tests/src/FunctionalJavascript/ListPageRssControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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('&lt;p&gt;this is a banana&lt;/p&gt; ', $first_item->filterXpath('//description')->html());
Expand All @@ -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']]));
Expand All @@ -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');
Expand Down

0 comments on commit b43ed24

Please sign in to comment.