Merge branch '4.0' into 4.1

* 4.0:
  [Form] Fix fixtures for forward compat
  [Lock] Fix SemaphoreStoreTest on OS X
This commit is contained in:
Nicolas Grekas 2018-06-30 19:31:31 +02:00
commit 8c1e299954
4 changed files with 19 additions and 10 deletions

View File

@ -15,9 +15,9 @@ Symfony\Component\Form\Extension\Core\Type\ChoiceType (choice_translation_domain
---------------- --------------------%s
Allowed values - %s
---------------- --------------------%s
Normalizer Closure%s{ %s
Normalizer Closure%s{%w
parameters: 2 %s
file: "%s%eExtension%eCore%eType%eChoiceType.php"
file: "%s%eExtension%eCore%eType%eChoiceType.php"%w
line: "%s to %s" %s
} %s
---------------- --------------------%s

View File

@ -8,14 +8,14 @@ Symfony\Component\Form\Tests\Console\Descriptor\FooType (empty_data)
Default Value: null %s
%s
Closure(s): [ %s
Closure%s{ %s
Closure%s{%w
parameters: 1 %s
file: "%s%eExtension%eCore%eType%eFormType.php"
file: "%s%eExtension%eCore%eType%eFormType.php"%w
line: "%s to %s" %s
}, %s
Closure%s{ %s
Closure%s{%w
parameters: 2 %s
file: "%s%eTests%eConsole%eDescriptor%eAbstractDescriptorTest.php"
file: "%s%eTests%eConsole%eDescriptor%eAbstractDescriptorTest.php"%w
line: "%s to %s" %s
} %s
] %s

View File

@ -16,9 +16,9 @@ Symfony\Component\Form\Tests\Console\Descriptor\FooType (foo)
"baz" %s
] %s
---------------- --------------------%s
Normalizer Closure%s{ %s
Normalizer Closure%s{%w
parameters: 2 %s
file: "%s%eTests%eConsole%eDescriptor%eAbstractDescriptorTest.php"
file: "%s%eTests%eConsole%eDescriptor%eAbstractDescriptorTest.php"%w
line: "%s to %s" %s
} %s
---------------- --------------------%s

View File

@ -46,13 +46,22 @@ class SemaphoreStoreTest extends AbstractStoreTest
private function getOpenedSemaphores()
{
if ('Darwin' === PHP_OS) {
$lines = explode(PHP_EOL, trim(`ipcs -s`));
if (-1 === $start = array_search('Semaphores:', $lines)) {
throw new \Exception('Failed to extract list of opened semaphores. Expected a Semaphore list, got '.implode(PHP_EOL, $lines));
}
return \count(\array_slice($lines, ++$start));
}
$lines = explode(PHP_EOL, trim(`LC_ALL=C ipcs -su`));
if ('------ Semaphore Status --------' !== $lines[0]) {
throw new \Exception('Failed to extract list of opend semaphores. Expect a Semaphore status, got '.implode(PHP_EOL, $lines));
throw new \Exception('Failed to extract list of opened semaphores. Expected a Semaphore status, got '.implode(PHP_EOL, $lines));
}
list($key, $value) = explode(' = ', $lines[1]);
if ('used arrays' !== $key) {
throw new \Exception('Failed to extract list of opend semaphores. Expect a used arrays key, got '.implode(PHP_EOL, $lines));
throw new \Exception('Failed to extract list of opened semaphores. Expected a "used arrays" key, got '.implode(PHP_EOL, $lines));
}
return (int) $value;