Skip to content
Snippets Groups Projects
Commit 26eac168 authored by Ghislain Loas's avatar Ghislain Loas
Browse files

holtine #83238 fix Biblix

parent f0515b15
Branches
Tags
4 merge requests!3297WIP: Master,!2922Master,!2921Hotline,!2920hotline #83238 fix DYNIX authentication
Pipeline #5538 failed with stage
in 27 minutes and 1 second
- ticket #83238 : SIGB Dynix : correction de l'autentification des abonnés avec le webservice du SIGB Dynix.
- ticket #83238 : Abonné SIGB : correction de l'autentification des abonnés avec les webservice des SIGB Dynix, VSmart, Biblix.
\ No newline at end of file
......@@ -42,10 +42,14 @@ class Class_Webservice_SIGB_BiblixNet_Service extends Class_WebService_SIGB_Abst
* @return Class_WebService_SIGB_Emprunteur
*/
public function getEmprunteur($user) {
return $this->ilsdiGetPatronInfo(array('patronId' => $user->getIdSigb(),
$borrower = $this->ilsdiGetPatronInfo(['patronId' => $user->getIdSigb(),
'showLoans' => '1',
'showHolds' => '1'),
Class_WebService_SIGB_BiblixNet_PatronInfoReader::newInstance());
'showHolds' => '1'],
Class_WebService_SIGB_BiblixNet_PatronInfoReader::newInstance());
if ($borrower->getId())
$borrower->beValid();
return $borrower;
}
......
......@@ -358,4 +358,48 @@ class BiblixNetOperationsTest extends BiblixNetTestCase {
}
?>
\ No newline at end of file
class BiblixAuthenticateTest extends ModelTestCase {
public function setUp() {
parent::setUp();
$mock = $this
->mock()
->whenCalled('open_url')
->with('http://www.annecy.fr/webservice/biblix.ilsdi?service=GetPatronInfo&showLoans=1&showHolds=1')
->answers(BiblixNetFixtures::xmlGetPatronJustinTicou())
->beStrict();
$service = Class_WebService_SIGB_BiblixNet::getService(['url_serveur' => 'http://www.annecy.fr/webservice/biblix.ilsdi']);
$service->setWebClient($mock);
$this->fixture('Class_IntBib',
['id' => 94,
'comm_sigb' => Class_IntBib::COM_BIBLIXNET,
'comm_params' => ['url_serveur' => 'http://www.annecy.fr/webservice/biblix.ilsdi']]);
$logger = $this
->mock()
->whenCalled('log')
->answers(true)
->whenCalled('logError')
->willDo(function($url, $message) {
throw new RuntimeException($url . ' :: ' . $message);
});
Class_WebService_SIGB_AbstractService::setLogger($logger);
$errors = ZendAfi_Auth::getInstance()->authenticateLoginPassword('10102003', 'secret');
}
/** @test */
public function EvelyneShouldBeLogged() {
if (!$user = Class_Users::getIdentity())
return $this->fail();
$this->assertEquals('10102003', $user->getLogin());
}
}
\ No newline at end of file
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