mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-29 11:03:50 +00:00
Fix Canceling of stale workflow cronjob
Refactor workflow cancellation logic to encapsulate transition checks in a dedicated method, and update CronJob handling to use entity workflows instead of IDs. Enhance test coverage to ensure proper handling and instantiate mocks for EntityManagerInterface.
This commit is contained in:
@@ -12,6 +12,7 @@ declare(strict_types=1);
|
||||
namespace ChillMainBundle\Tests\Repository;
|
||||
|
||||
use Chill\MainBundle\Entity\User;
|
||||
use Chill\MainBundle\Entity\Workflow\EntityWorkflow;
|
||||
use Chill\MainBundle\Repository\Workflow\EntityWorkflowRepository;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
|
||||
@@ -40,9 +41,13 @@ class EntityWorkflowRepositoryTest extends KernelTestCase
|
||||
{
|
||||
$repository = new EntityWorkflowRepository($this->em);
|
||||
|
||||
$actual = $repository->findWorkflowsWithoutFinalStepAndOlderThan(new \DateTimeImmutable('10 years ago'));
|
||||
$actual = $repository->findWorkflowsWithoutFinalStepAndOlderThan((new \DateTimeImmutable('now'))->add(new \DateInterval('P10Y')));
|
||||
|
||||
self::assertIsArray($actual, 'check that the query is successful');
|
||||
self::assertIsIterable($actual, 'check that the query is successful');
|
||||
|
||||
foreach ($actual as $entityWorkflow) {
|
||||
self::assertInstanceOf(EntityWorkflow::class, $entityWorkflow);
|
||||
}
|
||||
}
|
||||
|
||||
public function testCountQueryByDest(): void
|
||||
|
Reference in New Issue
Block a user