Skip to content

Commit 7ca997f

Browse files
authored
ref: add never as valid max_request_body_size (#966)
1 parent fbbdf82 commit 7ca997f

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

src/DependencyInjection/Configuration.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ public function getConfigTreeBuilder(): TreeBuilder
155155
->enumNode('max_request_body_size')
156156
->values([
157157
'none',
158+
'never',
158159
'small',
159160
'medium',
160161
'always',

tests/DependencyInjection/ConfigurationTest.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
use Doctrine\Bundle\DoctrineBundle\DoctrineBundle;
88
use PHPUnit\Framework\TestCase;
9+
use Sentry\Options;
910
use Sentry\SentryBundle\DependencyInjection\Configuration;
1011
use Symfony\Bundle\TwigBundle\TwigBundle;
1112
use Symfony\Component\Cache\CacheItem;
@@ -276,4 +277,23 @@ private function processConfiguration(array $values): array
276277

277278
return $processor->processConfiguration(new Configuration(), ['sentry' => $values]);
278279
}
280+
281+
/**
282+
* @dataProvider maxRequestBodySizeValuesDataProvider
283+
*/
284+
public function testMaxRequestBodySizeValues(string $maxRequestBodySize): void
285+
{
286+
$options = new Options();
287+
$options->setMaxRequestBodySize($maxRequestBodySize);
288+
$this->assertSame($maxRequestBodySize, $options->getMaxRequestBodySize());
289+
}
290+
291+
public function maxRequestBodySizeValuesDataProvider(): \Generator
292+
{
293+
yield ['never'];
294+
yield ['none'];
295+
yield ['small'];
296+
yield ['medium'];
297+
yield ['always'];
298+
}
279299
}

0 commit comments

Comments
 (0)