Commit c96d429d authored by Bastien Le Querrec's avatar Bastien Le Querrec
Browse files

fix test

parent 7fa005ef
......@@ -67,10 +67,10 @@ class AddressHandlerTest extends FunctionalTest
$latestAddress = $this->getLatestAddress();
$this->container['command_handler']->handle(new AddressUpdateCommand($latestAddress['id'], 1, 'LQDN', '115 rue de Ménilmontant', '', 75020, 'Paris', 'France', 'IDF'));
$this->container['command_handler']->handle(new AddressUpdateCommand(1, 1, 'LQDN', '115 rue de Ménilmontant', '', 75020, 'Paris', 'France', 'IDF'));
$expectedAddress = [
'id' => $latestAddress['id'],
'id' => '1',
'user_id' => '1',
'nom' => 'LQDN',
'adresse' => '115 rue de Ménilmontant',
......@@ -81,7 +81,7 @@ class AddressHandlerTest extends FunctionalTest
'etat' => 'IDF',
];
$updatedAddress = $this->getLatestAddress();
$updatedAddress = $this->getAddressById(1);
$this->assertSame($expectedAddress, $updatedAddress);
}
......@@ -106,4 +106,16 @@ class AddressHandlerTest extends FunctionalTest
{
return $this->container['db']->fetchAssoc("SELECT * FROM adresses ORDER BY id DESC LIMIT 1");
}
/**
* Retrieve address by its ID.
*
* @param int $id
*
* @return []
*/
private function getAddressById($id)
{
return $this->container['db']->fetchAssoc("SELECT id,user_id,nom,adresse,adresse2,codepostal,ville,pays,etat FROM adresses WHERE id = $id LIMIT 1");
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment