Skip to content

Commit d1b6040

Browse files
Merge branch '4.1'
* 4.1: Add color support for Hyper terminal . [HttpFoundation] Fix tests: new message for status 425 [Doctrine Bridge] Fixed usage of wrong variable when tagged subscriber is invalid [Workflow] Update phpdoc to fit a used className [PropertyInfo] added handling of nullable types in PhpDoc [HttpKernel] Make AbstractTestSessionListener compatible with CookieClearingLogoutHandler [Cache] provider does not respect option maxIdLength with versioning enabled [Form] Fix fixtures for forward compat [Lock] Fix SemaphoreStoreTest on OS X Ensure the class discriminator mechanism works with serialization groups as well fix handling of empty DI extension configs
2 parents 40fe44c + 5a3eb5c commit d1b6040

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

Tests/Store/SemaphoreStoreTest.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,22 @@ public function testResourceRemoval()
4646

4747
private function getOpenedSemaphores()
4848
{
49+
if ('Darwin' === PHP_OS) {
50+
$lines = explode(PHP_EOL, trim(`ipcs -s`));
51+
if (-1 === $start = array_search('Semaphores:', $lines)) {
52+
throw new \Exception('Failed to extract list of opened semaphores. Expected a Semaphore list, got '.implode(PHP_EOL, $lines));
53+
}
54+
55+
return \count(\array_slice($lines, ++$start));
56+
}
57+
4958
$lines = explode(PHP_EOL, trim(`LC_ALL=C ipcs -su`));
5059
if ('------ Semaphore Status --------' !== $lines[0]) {
51-
throw new \Exception('Failed to extract list of opend semaphores. Expect a Semaphore status, got '.implode(PHP_EOL, $lines));
60+
throw new \Exception('Failed to extract list of opened semaphores. Expected a Semaphore status, got '.implode(PHP_EOL, $lines));
5261
}
5362
list($key, $value) = explode(' = ', $lines[1]);
5463
if ('used arrays' !== $key) {
55-
throw new \Exception('Failed to extract list of opend semaphores. Expect a used arrays key, got '.implode(PHP_EOL, $lines));
64+
throw new \Exception('Failed to extract list of opened semaphores. Expected a "used arrays" key, got '.implode(PHP_EOL, $lines));
5665
}
5766

5867
return (int) $value;

0 commit comments

Comments
 (0)