Skip to content
Snippets Groups Projects
Commit c4bd58f8 authored by llaffont's avatar llaffont
Browse files

WS Koha: si ID_SIGB (numéro de carte), l'utilise à la place du login pour l'authentification

parent 820e6e9c
No related merge requests found
......@@ -36,7 +36,7 @@ class Class_WebService_SIGB_Koha_Service extends Class_WebService_SIGB_AbstractR
*/
protected function _authenticate($user) {
$xml_auth = $this->httpGet(array('service' => 'LookupPatron',
'id' => $user->getLogin(),
'id' => ($user->hasIdSigb() ? $user->getIdSigb() : $user->getLogin()),
'id_type' => 'cardnumber'));
return $this->_getTagData($xml_auth, 'id');
......
......@@ -328,14 +328,14 @@ class KohaGetEmprunteurLaurentLaffontTest extends KohaTestCase {
class KohaGetEmprunteurJeanAndreTest extends KohaTestCase {
class KohaGetEmprunteurJeanAndreWithIdSIGBTest extends KohaTestCase {
public function setUp() {
parent::setUp();
$this->mock_web_client
->expects($this->at(0))
->method('open_url')
->with('http://cat-aficg55.biblibre.com/cgi-bin/koha/ilsdi.pl?service=LookupPatron&id=SANTONI&id_type=cardnumber')
->with('http://cat-aficg55.biblibre.com/cgi-bin/koha/ilsdi.pl?service=LookupPatron&id=01234&id_type=cardnumber')
->will($this->returnValue(KohaFixtures::xmlLookupPatronJeanAndre()));
......@@ -346,10 +346,9 @@ class KohaGetEmprunteurJeanAndreTest extends KohaTestCase {
->will($this->returnValue(KohaFixtures::xmlGetPatronInfoJeanAndre()));
$this->jean = $this->service->getEmprunteur(
Class_Users::getLoader()->newInstance()
->setLogin('SANTONI')
->setPassword('zork')
);
Class_Users::newInstanceWithId(43, ['login' => 'JEAN',
'password' => 'zork',
'id_sigb' => '01234']));
}
......
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