Commit 73bd777d authored by Laurent's avatar Laurent
Browse files

dev #48981 fix test failure

parent cb146f3f
......@@ -412,13 +412,11 @@ class AbonneController extends ZendAfi_Controller_Action {
public function loansHistoryAction() {
try {
$loans = $this->_user->getLoansHistory();
$this->view->loans = $this->_user->getLoansHistory();
} catch (Class_WebService_Exception $e) {
$this->view->error = $e->getMessage();
$this->view->loans = new Storm_Collection();
}
if (!empty($loans))
$this->view->loans = $loans;
}
......
......@@ -1218,7 +1218,7 @@ class Class_Users extends Storm_Model_Abstract {
public function getLoansHistory() {
if (!($emprunteur = $this->getEmprunteur()))
return [];
return new Storm_Collection();
$history = (new Storm_Collection($emprunteur->getLoansHistory()))
->select(function($loan) {return $loan->getDateRetour();});
......
......@@ -180,6 +180,7 @@ class AbonneControllerLoansHistoryWithErrorTest extends AbonneControllerLoansHi
/** @test */
public function pageShouldDisplayWebServiceError() {
$this->assertXPathContentContains('//div[@class="error"]', 'Échec de la connexion au webservice, le SIGB a répondu "error"');
$this->assertXPathContentContains('//div[@class="error"]',
'Échec de la connexion au webservice, le SIGB a répondu "error"');
}
}
\ No newline at end of file
Markdown is supported
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