diff --git a/tests/http/stateless/ApplicationMemoryTest.php b/tests/http/stateless/ApplicationMemoryTest.php index 9e97d1e4..658a8b44 100644 --- a/tests/http/stateless/ApplicationMemoryTest.php +++ b/tests/http/stateless/ApplicationMemoryTest.php @@ -168,7 +168,7 @@ public function testClearOutputCleansLocalBuffers(): void /** * @throws InvalidConfigException if the configuration is invalid or incomplete. */ - public function testGetMemoryLimitHandlesUnlimitedMemoryCorrectly(): void + public function testMemoryLimitHandlesUnlimitedValues(): void { $originalLimit = ini_get('memory_limit'); @@ -179,39 +179,16 @@ public function testGetMemoryLimitHandlesUnlimitedMemoryCorrectly(): void self::assertSame( PHP_INT_MAX, $app->getMemoryLimit(), - "Memory limit should be 'PHP_INT_MAX' when set to '-1' (unlimited) in 'StatelessApplication'.", + "Before 'handle()' memory limit should be 'PHP_INT_MAX' when set to '-1' (unlimited).", ); $app->handle(FactoryHelper::createServerRequestCreator()->createFromGlobals()); $app->clean(); - ini_set('memory_limit', $originalLimit); - } - - /** - * @throws InvalidConfigException if the configuration is invalid or incomplete. - */ - public function testReturnPhpIntMaxWhenMemoryLimitIsUnlimited(): void - { - $originalLimit = ini_get('memory_limit'); - - ini_set('memory_limit', '-1'); - - $app = $this->statelessApplication(); - - $app->handle(FactoryHelper::createServerRequestCreator()->createFromGlobals()); - - self::assertSame( - PHP_INT_MAX, - $app->getMemoryLimit(), - "'getMemoryLimit()' should return 'PHP_INT_MAX' when 'memory_limit' is set to '-1' (unlimited) in " . - "'StatelessApplication'.", - ); self::assertSame( PHP_INT_MAX, $app->getMemoryLimit(), - "'getMemoryLimit()' should remain 'PHP_INT_MAX' after handling a request with unlimited memory in " . - "'StatelessApplication'.", + "After 'clean()' memory limit should remain 'PHP_INT_MAX' when set to '-1'.", ); ini_set('memory_limit', $originalLimit);