Skip to content
Snippets Groups Projects
Commit 2444bbba authored by efalcy's avatar efalcy
Browse files

hotline#88141 : koha fix post request on authenticatepatron

parent d3efee72
Branches
Tags
4 merge requests!3297WIP: Master,!3058Master,!3052Hotline,!3050hotline#88141 : koha fix post request on authenticatepatron
Pipeline #6519 passed with stage
in 34 minutes and 2 seconds
- ticket #88141 : SIGB KOHA : Correction de la requete d'authentification
\ No newline at end of file
......@@ -80,6 +80,8 @@ abstract class Class_WebService_SIGB_AbstractRESTService extends Class_WebServic
* @return string
*/
public function buildQueryURL($options) {
if (empty($options))
return $this->getServerRoot();
return sprintf('%s?%s', $this->getServerRoot(), http_build_query($options));
}
......
......@@ -78,8 +78,10 @@ class Class_WebService_SIGB_Koha_Service extends Class_WebService_SIGB_AbstractR
protected function _authenticateWebservice($user) {
$xml_auth = $this->httpPost(['service' => 'AuthenticatePatron'],
['username' => $user->getLogin(), 'password' => $user->getPassword()]);
$xml_auth = $this->httpPost([],
['service' => 'AuthenticatePatron',
'username' => $user->getLogin(),
'password' => $user->getPassword()]);
return $this->_getTagData($xml_auth, 'id');
}
......
......@@ -426,12 +426,11 @@ class KohaGetEmprunteurLaureAfondTest extends KohaTestCase {
$this->mock_web_client
->whenCalled('postData')
->with('http://cat-aficg55.biblibre.com/cgi-bin/koha/ilsdi.pl?service=AuthenticatePatron',
[ 'username' => 'lafond',
'password' => 'afi'])
->with('http://cat-aficg55.biblibre.com/cgi-bin/koha/ilsdi.pl',
['service' => 'AuthenticatePatron',
'username' => 'lafond',
'password' => 'afi'])
->answers(KohaFixtures::xmlLookupPatronLaure())
->whenCalled('open_url')
->with('http://cat-aficg55.biblibre.com/cgi-bin/koha/ilsdi.pl?service=GetPatronInfo&patron_id=572&show_contact=1&show_loans=1&show_holds=1')
->answers(KohaFixtures::xmlGetPatronInfoLaure());
......@@ -642,9 +641,10 @@ class KohaGetEmprunteurLisianneWithIdSIGBTest extends KohaTestCase {
$this->mock_web_client
->whenCalled('postData')
->with('http://cat-aficg55.biblibre.com/cgi-bin/koha/ilsdi.pl?service=AuthenticatePatron',
['username' => 'lisianne',
'password' => 'zork'])
->with('http://cat-aficg55.biblibre.com/cgi-bin/koha/ilsdi.pl',
[ 'service' => 'AuthenticatePatron',
'username' => 'lisianne',
'password' => 'zork'])
->answers(KohaFixtures::xmlLookupPatronLisianne())
->whenCalled('open_url')
->with('http://cat-aficg55.biblibre.com/cgi-bin/koha/ilsdi.pl?service=GetPatronInfo&patron_id=16186&show_contact=1&show_loans=1&show_holds=1')
......@@ -698,9 +698,10 @@ class KohaGetEmprunteurJeanAndreWithIdSIGBTest extends KohaTestCase {
$this->mock_web_client
->whenCalled('postData')
->with('http://cat-aficg55.biblibre.com/cgi-bin/koha/ilsdi.pl?service=AuthenticatePatron',
[ 'username' => 'JEAN',
'password' => 'zork'])
->with('http://cat-aficg55.biblibre.com/cgi-bin/koha/ilsdi.pl',
['service' => 'AuthenticatePatron',
'username' => 'JEAN',
'password' => 'zork'])
->answers(KohaFixtures::xmlLookupPatronJeanAndre())
->whenCalled('open_url')
......@@ -1224,8 +1225,10 @@ class KohaAuthenticateWSTest extends KohaTestCase {
parent::setUp();
$this->mock_web_client
->whenCalled('postData')
->with('http://cat-aficg55.biblibre.com/cgi-bin/koha/ilsdi.pl?service=AuthenticatePatron',
['username' => 'john', 'password' => '1989'])
->with('http://cat-aficg55.biblibre.com/cgi-bin/koha/ilsdi.pl',
['service' => 'AuthenticatePatron',
'username' => 'john',
'password' => '1989'])
->answers(KohaFixtures::xmlAuthenticatePatronOk())
->whenCalled('open_url')
......
......@@ -34,8 +34,9 @@ abstract class HandleBranchcodeTestCase extends AbstractControllerTestCase {
protected function _setMockWebClient() {
$this->mock_web_client
->whenCalled('postData')
->with($this->ilsdi . '?service=AuthenticatePatron',
['username' => 'Chambelle',
->with($this->ilsdi,
['service' => 'AuthenticatePatron',
'username' => 'Chambelle',
'password' => 'upw'])
->answers(ChamberyKohaFixtures::authenticatePatronChambelle())
......
......@@ -54,8 +54,9 @@ abstract class HandleOnholdTestCase extends AbstractControllerTestCase {
$this->_mock_web_client = $this->mock()
->whenCalled('postData')
->with($this->_ilsdi . '?service=AuthenticatePatron',
['username' => 'Chambelle',
->with($this->_ilsdi,
['service' => 'AuthenticatePatron',
'username' => 'Chambelle',
'password' => 'upw'])
->answers(ChamberyKohaFixtures::authenticatePatronChambelle());
......
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