Fix loading of random address reference in AddressToReferenceMatcherControllerTest.php

This commit is contained in:
Julien Fastré 2023-08-25 18:26:32 +02:00
parent 5136907d62
commit 1e353ed74b
Signed by: julienfastre
GPG Key ID: BDE2190974723FCB

View File

@ -42,7 +42,7 @@ class AddressToReferenceMatcherControllerTest extends WebTestCase
{
$client = $this->getClientAuthenticated();
$client->request('POST', "/api/1.0/main/address/reference-match/${addressId}/set/reviewed");
$client->request('POST', "/api/1.0/main/address/reference-match/{$addressId}/set/reviewed");
$this->assertResponseIsSuccessful();
@ -58,7 +58,7 @@ class AddressToReferenceMatcherControllerTest extends WebTestCase
{
$client = $this->getClientAuthenticated();
$client->request('POST', "/api/1.0/main/address/reference-match/${addressId}/sync-with-reference");
$client->request('POST', "/api/1.0/main/address/reference-match/{$addressId}/sync-with-reference");
$this->assertResponseIsSuccessful();
@ -108,7 +108,7 @@ class AddressToReferenceMatcherControllerTest extends WebTestCase
$ref = $em->createQuery('SELECT a FROM '.AddressReference::class.' a')
->setMaxResults(1)
->setFirstResult(random_int(0, $nb))
->setFirstResult(random_int(0, $nb - 1))
->getSingleResult();
$address = Address::createFromAddressReference($ref);