Skip to content
Snippets Groups Projects
Commit 5fc69d6d authored by efalcy's avatar efalcy
Browse files

hotline #72722 : fix loan history webservice called two times

parent 6b388083
Branches
Tags
2 merge requests!2560Hotline,!2556hotline #72722 : fix loan history webservice called two times
Pipeline #3708 failed with stage
in 51 minutes and 40 seconds
- ticket #72722 : SIGB Koha : corrige l'historique de prêt affiché en double.
\ No newline at end of file
......@@ -202,6 +202,9 @@ class Class_WebService_SIGB_Koha_Service extends Class_WebService_SIGB_AbstractR
if (!$this->providesLoansHistory())
return parent::loansHistory($user, $page);
if ($page > 1)
return new Class_WebService_SIGB_LoansHistory();
return $this
->getRestfulService()
->getLoansHistoryForUser($user);
......
......@@ -81,6 +81,37 @@ class AbonneControllerLoansHistoryWithoutServiceTest extends AbonneControllerLo
class AbonneControllerLoansHistoryPageSuccessfulTest extends AbonneControllerLoansHistoryTestCase {
public function setUp() {
parent::setUp();
$this->mock_web_client
->whenCalled('open_url')
->with(static::BASE_URL . 'rest.pl/user/byid/34/issues_history')
->answers(file_get_contents(realpath(dirname(__FILE__)) . '/../../../../fixtures/koha_issues_history_double.json'));
$this->dispatch('/abonne/loans-history', true);
}
/** @test */
public function firstTitleShouldBeSommetsDesAlpes() {
$this->assertXPathContentContains('//table//tr[1]//td', 'Sommets des Alpes d\'Azur');
}
/** @test */
public function secondTitleShouldBeSainteVictoire() {
$this->assertXPathContentContains('//table//tr[2]//td', 'Sainte-Victoire - Sainte-Baume');
}
}
class AbonneControllerLoansHistorySuccessfulTest extends AbonneControllerLoansHistoryTestCase {
public function setUp() {
......@@ -112,7 +143,7 @@ class AbonneControllerLoansHistorySuccessfulTest extends AbonneControllerLoansH
/** @test */
public function titleShouldBeDisplay() {
$this->assertXPathContentContains('//table', 'Cedric :Chaud et froid Vol 6');
$this->assertXPathContentContains('//table', 'Cedric :Chaud et froid Vol 6',$this->_response->getBody());
}
......
This diff is collapsed.
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