Merge branch '5.2' into 5.x
* 5.2: [Messenger][SQS] Document missing option Specify that we run CI on Ubuntu-20.04 zero parts can be omitted in date interval input
This commit is contained in:
commit
a8a0650161
2
.github/workflows/intl-data-tests.yml
vendored
2
.github/workflows/intl-data-tests.yml
vendored
@ -15,7 +15,7 @@ defaults:
|
||||
jobs:
|
||||
tests:
|
||||
name: Tests (intl-data)
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: Ubuntu-20.04
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
|
2
.github/workflows/tests.yml
vendored
2
.github/workflows/tests.yml
vendored
@ -11,7 +11,7 @@ defaults:
|
||||
jobs:
|
||||
integration:
|
||||
name: Integration
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: Ubuntu-20.04
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
|
@ -96,6 +96,7 @@ class Connection
|
||||
* * wait_time: long polling duration in seconds (Default: 20)
|
||||
* * poll_timeout: amount of seconds the transport should wait for new message
|
||||
* * visibility_timeout: amount of seconds the message won't be visible
|
||||
* * sslmode: Can be "disable" to use http for a custom endpoint
|
||||
* * auto_setup: Whether the queue should be created automatically during send / get (Default: true)
|
||||
* * debug: Log all HTTP requests and responses as LoggerInterface::DEBUG (Default: false)
|
||||
*/
|
||||
|
@ -96,7 +96,7 @@ class DateIntervalNormalizer implements NormalizerInterface, DenormalizerInterfa
|
||||
$dateIntervalFormat = substr($dateIntervalFormat, 2);
|
||||
break;
|
||||
}
|
||||
$valuePattern = '/^'.$signPattern.preg_replace('/%([yYmMdDhHiIsSwW])(\w)/', '(?P<$1>\d+)$2', $dateIntervalFormat).'$/';
|
||||
$valuePattern = '/^'.$signPattern.preg_replace('/%([yYmMdDhHiIsSwW])(\w)/', '(?:(?P<$1>\d+)$2)?', preg_replace('/(T.*)$/', '($1)?', $dateIntervalFormat)).'$/';
|
||||
if (!preg_match($valuePattern, $data)) {
|
||||
throw new UnexpectedValueException(sprintf('Value "%s" contains intervals not accepted by format "%s".', $data, $dateIntervalFormat));
|
||||
}
|
||||
|
@ -104,6 +104,14 @@ class DateIntervalNormalizerTest extends TestCase
|
||||
$this->assertDateIntervalEquals($this->getInterval($output), $normalizer->denormalize($input, \DateInterval::class));
|
||||
}
|
||||
|
||||
public function testDenormalizeIntervalsWithOmittedPartsBeingZero()
|
||||
{
|
||||
$normalizer = new DateIntervalNormalizer();
|
||||
|
||||
$this->assertDateIntervalEquals($this->getInterval('P3Y2M4DT0H0M0S'), $normalizer->denormalize('P3Y2M4D', \DateInterval::class));
|
||||
$this->assertDateIntervalEquals($this->getInterval('P0Y0M0DT12H34M0S'), $normalizer->denormalize('PT12H34M', \DateInterval::class));
|
||||
}
|
||||
|
||||
public function testDenormalizeExpectsString()
|
||||
{
|
||||
$this->expectException(InvalidArgumentException::class);
|
||||
|
Reference in New Issue
Block a user