Skip to content

Commit 5a600f0

Browse files
committed
test(symfony): ensure pagination_maximum_items_per_page defaults correctly when config defaults key is absent
1 parent c099892 commit 5a600f0

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/Symfony/Tests/Bundle/DependencyInjection/ApiPlatformExtensionTest.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,4 +381,14 @@ public function testPaginationMaximumItemsPerPageIsSetWithZero(): void
381381

382382
$this->assertSame(0, $this->container->getParameter('api_platform.collection.pagination.maximum_items_per_page'));
383383
}
384+
385+
public function testPaginationMaximumItemsPerPageWhenDefaultsKeyIsMissing(): void
386+
{
387+
$config = self::DEFAULT_CONFIG;
388+
unset($config['api_platform']['defaults']);
389+
(new ApiPlatformExtension())->load($config, $this->container);
390+
391+
$this->assertTrue($this->container->hasParameter('api_platform.collection.pagination.maximum_items_per_page'));
392+
$this->assertSame(30, $this->container->getParameter('api_platform.collection.pagination.maximum_items_per_page'));
393+
}
384394
}

0 commit comments

Comments
 (0)