Add MessageTest
This commit is contained in:
@@ -4,8 +4,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace Nsq;
|
||||
|
||||
use LogicException;
|
||||
|
||||
final class Message
|
||||
{
|
||||
/**
|
||||
@@ -50,7 +48,7 @@ final class Message
|
||||
public function finish(): void
|
||||
{
|
||||
if ($this->finished) {
|
||||
throw new LogicException('Can\'t finish message as it already finished.');
|
||||
throw new Exception('Can\'t finish message as it already finished.');
|
||||
}
|
||||
|
||||
$this->consumer->fin($this->id);
|
||||
@@ -60,7 +58,7 @@ final class Message
|
||||
public function requeue(int $timeout): void
|
||||
{
|
||||
if ($this->finished) {
|
||||
throw new LogicException('Can\'t requeue message as it already finished.');
|
||||
throw new Exception('Can\'t requeue message as it already finished.');
|
||||
}
|
||||
|
||||
$this->consumer->req($this->id, $timeout);
|
||||
@@ -70,7 +68,7 @@ final class Message
|
||||
public function touch(): void
|
||||
{
|
||||
if ($this->finished) {
|
||||
throw new LogicException('Can\'t touch message as it already finished.');
|
||||
throw new Exception('Can\'t touch message as it already finished.');
|
||||
}
|
||||
|
||||
$this->consumer->touch($this->id);
|
||||
|
Reference in New Issue
Block a user