Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 99aae50

Browse filesBrowse files
plantasfabpot
authored andcommitted
[BeanstalkMessenger] Round delay to an integer to avoid deprecation warning
1 parent c439a58 commit 99aae50
Copy full SHA for 99aae50

File tree

2 files changed

+22
-1
lines changed
Filter options

2 files changed

+22
-1
lines changed

‎src/Symfony/Component/Messenger/Bridge/Beanstalkd/Tests/Transport/ConnectionTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Messenger/Bridge/Beanstalkd/Tests/Transport/ConnectionTest.php
+21Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,4 +330,25 @@ public function testSendWhenABeanstalkdExceptionOccurs()
330330

331331
$connection->send($body, $headers, $delay);
332332
}
333+
334+
public function testSendWithRoundedDelay()
335+
{
336+
$tube = 'xyz';
337+
$body = 'foo';
338+
$headers = ['test' => 'bar'];
339+
$delay = 920;
340+
$expectedDelay = 0;
341+
342+
$client = $this->createMock(PheanstalkInterface::class);
343+
$client->expects($this->once())->method('useTube')->with($tube)->willReturn($client);
344+
$client->expects($this->once())->method('put')->with(
345+
$this->anything(),
346+
$this->anything(),
347+
$expectedDelay,
348+
$this->anything(),
349+
);
350+
351+
$connection = new Connection(['tube_name' => $tube], $client);
352+
$connection->send($body, $headers, $delay);
353+
}
333354
}

‎src/Symfony/Component/Messenger/Bridge/Beanstalkd/Transport/Connection.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Messenger/Bridge/Beanstalkd/Transport/Connection.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ public function send(string $body, array $headers, int $delay = 0): string
123123
$job = $this->client->useTube($this->tube)->put(
124124
$message,
125125
PheanstalkInterface::DEFAULT_PRIORITY,
126-
$delay / 1000,
126+
(int) ($delay / 1000),
127127
$this->ttr
128128
);
129129
} catch (Exception $exception) {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.