mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-23 08:03:49 +00:00
[Ticket] add filter by addressee on ticket list api
This commit is contained in:
@@ -11,6 +11,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace Chill\TicketBundle\Tests\Repository;
|
||||
|
||||
use Chill\MainBundle\Entity\User;
|
||||
use Chill\PersonBundle\DataFixtures\Helper\RandomPersonHelperTrait;
|
||||
use Chill\TicketBundle\Entity\EmergencyStatusEnum;
|
||||
use Chill\TicketBundle\Entity\Motive;
|
||||
@@ -123,4 +124,19 @@ class TicketACLAwareRepositoryTest extends KernelTestCase
|
||||
|
||||
self::assertIsArray($actual);
|
||||
}
|
||||
|
||||
public function testFindByAddressee(): void
|
||||
{
|
||||
$users = $this->entityManager->createQuery('SELECT u FROM '.User::class.' u')
|
||||
->setMaxResults(2)
|
||||
->getResult();
|
||||
|
||||
if ([] === $users) {
|
||||
throw new \UnexpectedValueException('No users found');
|
||||
}
|
||||
|
||||
$actual = $this->repository->findTickets(['byAddressee' => $users]);
|
||||
|
||||
self::assertIsArray($actual);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user