diff --git a/models/classes/taskQueue/Queue.php b/models/classes/taskQueue/Queue.php index 2feeb3020e..20eb42d99d 100644 --- a/models/classes/taskQueue/Queue.php +++ b/models/classes/taskQueue/Queue.php @@ -203,10 +203,8 @@ public function acknowledge(TaskInterface $task) /** * Count of messages in the queue. - * - * @return int */ - public function count() + public function count(): int { return $this->getBroker()->count(); } diff --git a/test/unit/model/taskQueue/QueueTest.php b/test/unit/model/taskQueue/QueueTest.php index 0b9791f56f..f44fd53c5a 100644 --- a/test/unit/model/taskQueue/QueueTest.php +++ b/test/unit/model/taskQueue/QueueTest.php @@ -223,7 +223,7 @@ public function testCountShouldCallCountOnBroker() $queueBrokerMock = $this->getMockForAbstractClass(QueueBrokerInterface::class); $queueBrokerMock->expects($this->once()) - ->method('count'); + ->method('count')->willReturn(1); /** @var Queue|MockObject $queueMock */ $queueMock = $this->getMockBuilder(Queue::class)