diff --git a/src/Symfony/Tests/Bundle/DependencyInjection/ApiPlatformExtensionTest.php b/src/Symfony/Tests/Bundle/DependencyInjection/ApiPlatformExtensionTest.php index 29e184fd13..2110e1814f 100644 --- a/src/Symfony/Tests/Bundle/DependencyInjection/ApiPlatformExtensionTest.php +++ b/src/Symfony/Tests/Bundle/DependencyInjection/ApiPlatformExtensionTest.php @@ -381,4 +381,15 @@ public function testPaginationMaximumItemsPerPageIsSetWithZero(): void $this->assertSame(0, $this->container->getParameter('api_platform.collection.pagination.maximum_items_per_page')); } + + public function testPaginationMaximumItemsPerPageWhenDefaultsKeyIsMissing(): void + { + $config = self::DEFAULT_CONFIG; + $apiPlatformConfig = $config['api_platform']; + unset($apiPlatformConfig['defaults']); + (new ApiPlatformExtension())->load($config, $this->container); + + $this->assertTrue($this->container->hasParameter('api_platform.collection.pagination.maximum_items_per_page')); + $this->assertSame(30, $this->container->getParameter('api_platform.collection.pagination.maximum_items_per_page')); + } }