Skip to content

Commit

Permalink
Merge branch '6.4' into 7.1
Browse files Browse the repository at this point in the history
* 6.4:
  [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
  • Loading branch information
fabpot committed Dec 11, 2024
2 parents f58ceac + 859c894 commit dec70fe
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
21 changes: 21 additions & 0 deletions Tests/Transport/ConnectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -330,4 +330,25 @@ public function testSendWhenABeanstalkdExceptionOccurs()

$connection->send($body, $headers, $delay);
}

public function testSendWithRoundedDelay()
{
$tube = 'xyz';
$body = 'foo';
$headers = ['test' => 'bar'];
$delay = 920;
$expectedDelay = 0;

$client = $this->createMock(PheanstalkInterface::class);
$client->expects($this->once())->method('useTube')->with($tube)->willReturn($client);
$client->expects($this->once())->method('put')->with(
$this->anything(),
$this->anything(),
$expectedDelay,
$this->anything(),
);

$connection = new Connection(['tube_name' => $tube], $client);
$connection->send($body, $headers, $delay);
}
}
2 changes: 1 addition & 1 deletion Transport/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public function send(string $body, array $headers, int $delay = 0): string
$job = $this->client->useTube($this->tube)->put(
$message,
PheanstalkInterface::DEFAULT_PRIORITY,
$delay / 1000,
(int) ($delay / 1000),
$this->ttr
);
} catch (Exception $exception) {
Expand Down

0 comments on commit dec70fe

Please sign in to comment.