Skip to content

Commit 146e8ea

Browse files
committed
Fix memory limit in PhpSubprocess unit test
1 parent 12f9ebe commit 146e8ea

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Tests/PhpSubprocessTest.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public static function subprocessProvider(): \Generator
4747
yield 'Process does ignore dynamic memory_limit' => [
4848
'Process',
4949
self::getRandomMemoryLimit(),
50-
self::getCurrentMemoryLimit(),
50+
self::getDefaultMemoryLimit(),
5151
];
5252

5353
yield 'PhpSubprocess does not ignore dynamic memory_limit' => [
@@ -57,16 +57,16 @@ public static function subprocessProvider(): \Generator
5757
];
5858
}
5959

60-
private static function getCurrentMemoryLimit(): string
60+
private static function getDefaultMemoryLimit(): string
6161
{
62-
return trim(\ini_get('memory_limit'));
62+
return trim(ini_get_all()['memory_limit']['global_value']);
6363
}
6464

6565
private static function getRandomMemoryLimit(): string
6666
{
6767
$memoryLimit = 123; // Take something that's really unlikely to be configured on a user system.
6868

69-
while (($formatted = $memoryLimit.'M') === self::getCurrentMemoryLimit()) {
69+
while (($formatted = $memoryLimit.'M') === self::getDefaultMemoryLimit()) {
7070
++$memoryLimit;
7171
}
7272

0 commit comments

Comments
 (0)