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

Creation web services BiblixNet

parent c0c56813
Branches
Tags
No related merge requests found
......@@ -1856,6 +1856,8 @@ library/Class/WebService/ResumptionToken.php -text
library/Class/WebService/SIGB/AbstractRESTService.php -text
library/Class/WebService/SIGB/AbstractService.php -text
library/Class/WebService/SIGB/AbstractXMLNoticeReader.php -text
library/Class/WebService/SIGB/BiblixNet.php -text
library/Class/WebService/SIGB/BiblixNet/Service.php -text
library/Class/WebService/SIGB/Carthame.php -text
library/Class/WebService/SIGB/Carthame/AccountResponseReader.php -text
library/Class/WebService/SIGB/Carthame/RecordResponseReader.php -text
......@@ -3698,6 +3700,7 @@ tests/library/Class/WebService/OAIListSets.xml -text
tests/library/Class/WebService/OAITest.php -text
tests/library/Class/WebService/OPDS/CatalogEntryTest.php -text
tests/library/Class/WebService/ReseauxSociauxTest.php -text
tests/library/Class/WebService/SIGB/BiblixNetTest.php -text
tests/library/Class/WebService/SIGB/CarthameTest.php -text
tests/library/Class/WebService/SIGB/EmpruntTest.php -text
tests/library/Class/WebService/SIGB/EmprunteurCacheTest.php -text
......
<?php
/**
* Copyright (c) 2012, Agence Française Informatique (AFI). All rights reserved.
*
* AFI-OPAC 2.0 is free software; you can redistribute it and/or modify
* it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by
* the Free Software Foundation.
*
* There are special exceptions to the terms and conditions of the AGPL as it
* is applied to this software (see README file).
*
* AFI-OPAC 2.0 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
* along with AFI-OPAC 2.0; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class Class_WebService_SIGB_BiblixNet {
protected static $service;
public static function getService($params){
if (!isset(self::$service)) {
$instance = new self();
self::$service = Class_WebService_SIGB_BiblixNet_Service::getService($params['url_serveur']);
}
return self::$service;
}
public static function setService($service) {
self::$service = $service;
}
public static function reset() {
self::$service = null;
}
}
?>
\ No newline at end of file
<?php
/**
* Copyright (c) 2012, Agence Française Informatique (AFI). All rights reserved.
*
* AFI-OPAC 2.0 is free software; you can redistribute it and/or modify
* it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by
* the Free Software Foundation.
*
* There are special exceptions to the terms and conditions of the AGPL as it
* is applied to this software (see README file).
*
* AFI-OPAC 2.0 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
* along with AFI-OPAC 2.0; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class Class_Webservice_SIGB_BiblixNet_Service extends Class_WebService_SIGB_AbstractRESTService {
/**
* @return Class_Webservice_SIGB_BiblixNet_Service
*/
public static function newInstance() {
return new self();
}
/**
* @param string $server_root
* @return Class_Webservice_SIGB_BiblixNet_Service
*/
public static function getService($server_root) {
return self::newInstance()->setServerRoot($server_root);
}
public function getEmprunteur($user) {}
public function reserverExemplaire($user, $exemplaire, $code_annexe) {}
public function supprimerReservation($user, $reservation_id) {}
public function prolongerPret($user, $pret_id) {}
public function getNotice($id) {}
}
?>
\ No newline at end of file
<?php
/**
* Copyright (c) 2012, Agence Française Informatique (AFI). All rights reserved.
*
* AFI-OPAC 2.0 is free software; you can redistribute it and/or modify
* it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by
* the Free Software Foundation.
*
* There are special exceptions to the terms and conditions of the AGPL as it
* is applied to this software (see README file).
*
* AFI-OPAC 2.0 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
* along with AFI-OPAC 2.0; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class BiblixNetGetServiceTest extends PHPUnit_Framework_TestCase {
public function setUp() {
Class_WebService_SIGB_BiblixNet::reset();
$this->service = Class_WebService_SIGB_BiblixNet::getService(array('url_serveur' => 'http://mediathequewormhout.biblixnet.com/exporte_afi/'));
}
/** @test */
public function getServiceShouldCreateAnInstanceOfBiblixNetService() {
$this->assertInstanceOf('Class_WebService_SIGB_BiblixNet_Service',
$this->service);
}
/** @test */
public function serverRootShouldBeLocalBiblixNetIlsdiService() {
$this->assertEquals('http://mediathequewormhout.biblixnet.com/exporte_afi/',
$this->service->getServerRoot());
}
}
?>
\ 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