mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2026-04-10 06:53:45 +00:00
Add filtering tickets by person center
This commit is contained in:
@@ -11,6 +11,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace Chill\TicketBundle\Tests\Repository;
|
||||
|
||||
use Chill\MainBundle\Entity\Center;
|
||||
use Chill\MainBundle\Entity\User;
|
||||
use Chill\MainBundle\Entity\UserGroup;
|
||||
use Chill\PersonBundle\DataFixtures\Helper\RandomPersonHelperTrait;
|
||||
@@ -192,4 +193,19 @@ class TicketACLAwareRepositoryTest extends KernelTestCase
|
||||
|
||||
self::assertIsArray($actual);
|
||||
}
|
||||
|
||||
public function testFindByPersonCenter(): void
|
||||
{
|
||||
$centers = $this->entityManager->createQuery('SELECT c FROM '.Center::class.' c')
|
||||
->setMaxResults(2)
|
||||
->getResult();
|
||||
|
||||
if ([] === $centers) {
|
||||
throw new \UnexpectedValueException('No centers found');
|
||||
}
|
||||
|
||||
$actual = $this->repository->findTickets(['byPersonCenter' => $centers]);
|
||||
|
||||
self::assertIsArray($actual);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user