mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Fix data provider for person, using the association with person center current
This commit is contained in:
parent
1e353ed74b
commit
ad1e5ecc95
@ -33,9 +33,10 @@ final class PersonApiControllerTest extends WebTestCase
|
||||
{
|
||||
self::bootKernel();
|
||||
$em = self::$container->get(EntityManagerInterface::class);
|
||||
$personIds = $em->createQuery('SELECT p.id FROM ' . Person::class . ' p ' .
|
||||
'JOIN p.center c ' .
|
||||
'WHERE c.name = :center')
|
||||
$personIds = $em->createQuery(sprintf(
|
||||
"SELECT p.id FROM %s p JOIN p.centerCurrent pc JOIN pc.center c WHERE c.name = :center",
|
||||
Person::class
|
||||
))
|
||||
->setParameter('center', 'Center A')
|
||||
->setMaxResults(100)
|
||||
->getScalarResult();
|
||||
@ -55,9 +56,9 @@ final class PersonApiControllerTest extends WebTestCase
|
||||
{
|
||||
self::bootKernel();
|
||||
$em = self::$container->get(EntityManagerInterface::class);
|
||||
$personIds = $em->createQuery('SELECT p.id FROM ' . Person::class . ' p ' .
|
||||
'JOIN p.center c ' .
|
||||
'WHERE c.name = :center')
|
||||
$personIds = $em->createQuery(
|
||||
sprintf("SELECT p.id FROM %s p JOIN p.centerCurrent pc JOIN pc.center c WHERE c.name = :center", Person::class)
|
||||
)
|
||||
->setParameter('center', 'Center B')
|
||||
->setMaxResults(100)
|
||||
->getScalarResult();
|
||||
@ -72,7 +73,7 @@ final class PersonApiControllerTest extends WebTestCase
|
||||
/**
|
||||
* @dataProvider dataGetPersonFromCenterA
|
||||
*/
|
||||
public function testPersonAddressSuggestion(mixed $personId): void
|
||||
public function testPersonAddressSuggestion(int $personId): void
|
||||
{
|
||||
$client = $this->getClientAuthenticated();
|
||||
|
||||
@ -97,7 +98,7 @@ final class PersonApiControllerTest extends WebTestCase
|
||||
/**
|
||||
* @dataProvider dataGetPersonFromCenterA
|
||||
*/
|
||||
public function testPersonGet(mixed $personId): void
|
||||
public function testPersonGet(int $personId): void
|
||||
{
|
||||
$client = $this->getClientAuthenticated();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user