Skip to content

Commit

Permalink
fix:fix compatibility to php7.2
Browse files Browse the repository at this point in the history
  • Loading branch information
siwane committed Feb 3, 2022
1 parent 27f8908 commit 76b290b
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions test/unit/model/taskQueue/Worker/AbstractWorkerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
use oat\tao\model\taskQueue\TaskLog\Entity\EntityInterface;
use oat\tao\model\taskQueue\TaskLogInterface;
use oat\tao\model\taskQueue\Worker\AbstractWorker;
use oat\tao\model\webhooks\task\WebhookTask;
use oat\generis\test\MockObject;
use Zend\ServiceManager\ServiceLocatorInterface;

Expand Down Expand Up @@ -76,10 +75,12 @@ class AbstractWorkerTest extends TestCase
* @var common_session_Session | MockObject
*/
private $commonSession;

/**
* @var User | MockObject
*/
private $userMock;

/**
* @var UserFactoryServiceInterface | MockObject
*/
Expand All @@ -99,6 +100,7 @@ class AbstractWorkerTest extends TestCase
* @var core_kernel_classes_Resource | MockObject
*/
private $userResourceMock;

/**
* @var LoggerService | MockObject
*/
Expand All @@ -108,6 +110,7 @@ class AbstractWorkerTest extends TestCase
* @var common_report_Report | MockObject
*/
private $reportMock;

/**
* @var RemoteTaskSynchroniserInterface | MockObject
*/
Expand All @@ -123,7 +126,10 @@ class AbstractWorkerTest extends TestCase
*/
private $queueDispatcherMock;

private TaskLanguageLoaderInterface $taskLanguageLoader;
/**
* @var TaskLanguageLoaderInterface | MockObject
*/
private $taskLanguageLoader;

protected function setUp(): void
{
Expand Down Expand Up @@ -331,7 +337,7 @@ public function testProcessCancelledTask()
);

$this->queue->expects($this->once())->method('acknowledge')->with($task);
$this->taskLanguageLoader->expects($this->once())->method('loadTranslations')->with($this->taskMock);
$this->taskLanguageLoader->expects($this->never())->method('loadTranslations');

$this->assertEquals(TaskLogInterface::STATUS_CANCELLED, $this->subject->processTask($task));
}
Expand All @@ -352,7 +358,7 @@ public function testProcessTaskStartUserSession()

$this->loggerServiceMock->expects($this->exactly(2))->method('info');
$this->sessionServiceMock->expects($this->once())->method('setSession');
$this->taskLanguageLoader->expects($this->once())->method('loadTranslations')->with($this->taskMock);
$this->taskLanguageLoader->expects($this->never())->method('loadTranslations');

$result = $this->subject->processTask($this->taskMock);
$this->assertSame('unknown', $result);
Expand Down

0 comments on commit 76b290b

Please sign in to comment.