Skip to content

EspoCRM – Open Source CRM Application

fix test

Yuri Kuznetsovedb2dc6a5a3e
diff --git a/tests/integration/Espo/Core/Job/JobTest.php b/tests/integration/Espo/Core/Job/JobTest.php
index 69aa49e192..805cf3e338 100644
--- a/tests/integration/Espo/Core/Job/JobTest.php
+++ b/tests/integration/Espo/Core/Job/JobTest.php
@@ -35,6 +35,7 @@ use Espo\Core\Job\JobManager;
use Espo\Core\Job\JobSchedulerFactory;
use Espo\Core\Job\QueueName;
+use Espo\Entities\Job as JobEntity;
use Espo\ORM\EntityManager;
use tests\integration\Core\BaseTestCase;
use tests\integration\testClasses\Job\Job as TestJob;
@@ -70,7 +71,7 @@ class JobTest extends BaseTestCase
public function testScheduler(): void
{
- $job = $this->schedulerFactory
+ $this->schedulerFactory
->create()
->setClassName(TestJob::class)
->setQueue(QueueName::Q0)
@@ -78,9 +79,14 @@ class JobTest extends BaseTestCase
$this->jobManager->processQueue(QueueName::Q0, 10);
- $jobReloaded = $this->entityManager->getEntityById('Job', $job->getId());
+ $job = $this->entityManager
+ ->getRDBRepositoryByClass(JobEntity::class)
+ ->where(['className' => TestJob::class])
+ ->findOne();
- $this->assertEquals(Status::SUCCESS, $jobReloaded->getStatus());
+ $this->assertNotNull($job);
+
+ $this->assertEquals(Status::SUCCESS, $job->getStatus());
}
public function testProcessQueueNoGroup(): void