Skip to content

Commit 4a9a37c

Browse files
committed
Merge branch '7.1' into 7.2
* 7.1: Fix resolve enum in string type resolver [PropertyInfo] Upmerge #59012 [BeanstalkMessenger] Round delay to an integer to avoid deprecation warning [PropertyInfo] Fix interface handling in `PhpStanTypeHelper` [HttpClient] Test POST to GET redirects [HttpKernel] Denormalize request data using the csv format when using "#[MapQueryString]" or "#[MapRequestPayload]" (except for content data) fix: preserve and nowrap in profiler code highlighting
2 parents cda6f72 + dec70fe commit 4a9a37c

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

Tests/Transport/ConnectionTest.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,4 +363,25 @@ public function testKeepaliveWhenABeanstalkdExceptionOccurs()
363363
$this->expectExceptionObject(new TransportException($exception->getMessage(), 0, $exception));
364364
$connection->keepalive((string) $id);
365365
}
366+
367+
public function testSendWithRoundedDelay()
368+
{
369+
$tube = 'xyz';
370+
$body = 'foo';
371+
$headers = ['test' => 'bar'];
372+
$delay = 920;
373+
$expectedDelay = 0;
374+
375+
$client = $this->createMock(PheanstalkInterface::class);
376+
$client->expects($this->once())->method('useTube')->with($tube)->willReturn($client);
377+
$client->expects($this->once())->method('put')->with(
378+
$this->anything(),
379+
$this->anything(),
380+
$expectedDelay,
381+
$this->anything(),
382+
);
383+
384+
$connection = new Connection(['tube_name' => $tube], $client);
385+
$connection->send($body, $headers, $delay);
386+
}
366387
}

Transport/Connection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ public function send(string $body, array $headers, int $delay = 0): string
124124
$job = $this->client->useTube($this->tube)->put(
125125
$message,
126126
PheanstalkInterface::DEFAULT_PRIORITY,
127-
$delay / 1000,
127+
(int) ($delay / 1000),
128128
$this->ttr
129129
);
130130
} catch (Exception $exception) {

0 commit comments

Comments
 (0)