Add support for handling user groups in workflow counters and list workflows in "my workflows" controller

- rewrite queries in repositories;
- fix cache key cleaning for members of users when a workflow is transitionned
This commit is contained in:
2024-09-26 17:44:31 +02:00
parent 87599425df
commit 0c1d9ee4be
5 changed files with 76 additions and 1 deletions

View File

@@ -11,6 +11,7 @@ declare(strict_types=1);
namespace ChillMainBundle\Tests\Repository;
use Chill\MainBundle\Entity\User;
use Chill\MainBundle\Repository\Workflow\EntityWorkflowRepository;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
@@ -43,4 +44,14 @@ class EntityWorkflowRepositoryTest extends KernelTestCase
self::assertIsArray($actual, 'check that the query is successful');
}
public function testCountQueryByDest(): void
{
$repository = new EntityWorkflowRepository($this->em);
$user = $this->em->createQuery(sprintf('SELECT u FROM %s u', User::class))
->setMaxResults(1)->getSingleResult();
$actual = $repository->countByDest($user);
self::assertIsInt($actual);
}
}