diff --git a/application/modules/opac/controllers/NoticeajaxController.php b/application/modules/opac/controllers/NoticeajaxController.php index 58400410752c71c6d9102981e01dd55f60e29689..6261feab1e2a9e2804d32dd1d3bf892fc735a13a 100644 --- a/application/modules/opac/controllers/NoticeajaxController.php +++ b/application/modules/opac/controllers/NoticeajaxController.php @@ -145,7 +145,7 @@ class NoticeAjaxController extends Zend_Controller_Action { protected function _loadExemplaireWhere($where) { // Lire les notices groupees ou pas if (0 == $this->notice_html->preferences["exemplaires"]["grouper"]) - return fetchAll("Select id_notice,id_bib,cote,count(*) from exemplaires " . $where . " group by 1,2,3" ); + return fetchAll("Select id_notice,id_bib,cote,count(*),id_int_bib,id_origine from exemplaires " . $where . " group by 1,2,3" ); return fetchAll("Select * from exemplaires " . $where); } diff --git a/cosmogramme/php/fonctions/objets_saisie.php b/cosmogramme/php/fonctions/objets_saisie.php index 6bbe3ffd33573d666891e0c5dd90fcd107aeee48..818585f6c7b4573561223e01718da45292c2830a 100644 --- a/cosmogramme/php/fonctions/objets_saisie.php +++ b/cosmogramme/php/fonctions/objets_saisie.php @@ -90,7 +90,7 @@ function getBlocsParams($id_bib, $type, $valeurs) { $champs_params[0] = ['url_serveur']; if (in_array($clef, [COM_CARTHAME])) - $champs_params[0] = ['url_serveur', 'key']; + $champs_params[0] = ['url_serveur', 'key','sigb_field_name']; if (in_array($clef, [COM_ORPHEE])) $champs_params[0] = ['url_serveur', 'key', 'allow_hold_available_items']; diff --git a/library/Class/WebService/SIGB/Carthame.php b/library/Class/WebService/SIGB/Carthame.php index 5e2034ee13ee77b5561fb9b1c82974faad03c93b..b46e780c0c9609f7355cf10f63400d3d7af07bb2 100644 --- a/library/Class/WebService/SIGB/Carthame.php +++ b/library/Class/WebService/SIGB/Carthame.php @@ -16,7 +16,7 @@ * * 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 + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ class Class_WebService_SIGB_Carthame { @@ -25,8 +25,9 @@ class Class_WebService_SIGB_Carthame { public static function getService($params){ if (!isset(self::$service)) { self::$service = Class_WebService_SIGB_Carthame_Service::getService( - $params['url_serveur'], - isset($params['key']) ? $params['key'] : null); + $params['url_serveur'], + isset($params['key']) ? $params['key'] : null, + isset($params['sigb_field_name'])? $params['sigb_field_name'] : 'ktm'); } return self::$service; diff --git a/library/Class/WebService/SIGB/Carthame/Service.php b/library/Class/WebService/SIGB/Carthame/Service.php index 5aa8e37c39a3f66f9d023b08b82c17221428313e..5c29a544719c2195197254d1d359c9cc1db7e504 100644 --- a/library/Class/WebService/SIGB/Carthame/Service.php +++ b/library/Class/WebService/SIGB/Carthame/Service.php @@ -16,23 +16,25 @@ * * 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 + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ class Class_WebService_SIGB_Carthame_Service extends Class_WebService_SIGB_AbstractRESTService { protected $_key; protected $_translate; protected $_hold_error_messages; + protected $_sigb_field_name = "ktm"; /** * @param string $server_root * @return Class_WebService_SIGB_Carthame_Service */ - public static function getService($server_root, $key) { + public static function getService($server_root, $key = null, $sigb_field_name="ktm") { return self::newInstance() ->setServerRoot($server_root) ->setKey($key) - ->setTranslate(Zend_Registry::get('translate')); + ->setTranslate(Zend_Registry::get('translate')) + ->setSigbFieldName($sigb_field_name); } @@ -46,8 +48,8 @@ class Class_WebService_SIGB_Carthame_Service extends Class_WebService_SIGB_Abstr } - /** - * @param $translate Zend_Translate + /** + * @param $translate Zend_Translate * @return self */ public function setTranslate($translate) { @@ -55,18 +57,24 @@ class Class_WebService_SIGB_Carthame_Service extends Class_WebService_SIGB_Abstr return $this; } + public function setSigbFieldName($sigb_field_name) { + $this->_sigb_field_name=$sigb_field_name; + return $this; + } /** * @param Class_Users $user * @return Class_WebService_SIGB_Emprunteur */ public function getEmprunteur($user) { - $userId = $this->_authenticate($user); + if (!$userId = $this->_authenticate($user)) + return Class_WebService_SIGB_Emprunteur::nullInstance(); $xml = $this->_callAction('accountDetails', ['userid' => $userId]); - $account = Class_WebService_SIGB_Carthame_AccountResponseReader::newInstance() ->getAccountFromXml($xml); - + if ($account) + $account->setPassword($user->getPassword()) + ->beValid(); return $account->setId($userId) ->setService($this); } @@ -153,6 +161,8 @@ class Class_WebService_SIGB_Carthame_Service extends Class_WebService_SIGB_Abstr protected function _authenticate($user) { $response = $this->_callAction('login', ['username'=> (string)$user->getLogin(), 'password'=> (string)$user->getPassword()]); + if ($this->_getTagData($response, 'error')) + return false; return $this->_getTagData($response, 'id'); } @@ -163,7 +173,7 @@ class Class_WebService_SIGB_Carthame_Service extends Class_WebService_SIGB_Abstr * @return string */ protected function _callAction($action, $params=[]) { - $options = ['sigb' => 'ktm', + $options = ['sigb' => $this->_sigb_field_name, 'version' => 'standalone']; if ($this->_key) $options['idclient'] = $this->_key; diff --git a/library/ZendAfi/View/Helper/Notice/Exemplaires.php b/library/ZendAfi/View/Helper/Notice/Exemplaires.php index 8fd6d5bd8acc67061cbc675c8684bc3a2efd3c0a..3cd46d0567a4e3eafe755474c1dba3ab1f44668e 100644 --- a/library/ZendAfi/View/Helper/Notice/Exemplaires.php +++ b/library/ZendAfi/View/Helper/Notice/Exemplaires.php @@ -16,7 +16,7 @@ * * 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 + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ class ZendAfi_View_Helper_Notice_Exemplaires extends Zend_View_Helper_HtmlElement { use Trait_Translator; @@ -32,10 +32,11 @@ class ZendAfi_View_Helper_Notice_Exemplaires extends Zend_View_Helper_HtmlElemen // Recup des donnees de dispo et reservable $cls_comm = null; - if ($preferences["grouper"] == 1) { + xdebug_break(); +// if ($preferences["grouper"] == 1) { $cls_comm = new Class_CommSigb(); $exemplaires = $cls_comm->getDispoExemplaires($exemplaires); - } +// } $cote_libelle = $this->_('Cote').$this->editionLabelle($exemplaires); @@ -61,7 +62,7 @@ class ZendAfi_View_Helper_Notice_Exemplaires extends Zend_View_Helper_HtmlElemen { // Infos bib $bib=fetchEnreg("select LIBELLE,GOOGLE_MAP,INTERDIRE_RESA from bib_c_site where ID_SITE=".$ex["id_bib"]); - + // html $html.='<tr>'; $html.='<td class="num">'.++$num.'</td>'; @@ -94,19 +95,19 @@ class ZendAfi_View_Helper_Notice_Exemplaires extends Zend_View_Helper_HtmlElemen if($preferences["localisation"]==1) { $html.='<td class="localisation" style="text-align:center">'; - - if(!isset($controle[$ex["id_bib"]])) + + if(!isset($controle[$ex["id_bib"]])) $controle[$ex["id_bib"]]=fetchOne("select count(*) from bib_localisations where ID_BIB=".$ex["id_bib"]); - + $onclick="localisationExemplaire(this,".$ex["id_bib"].",'".$ex["cote"]."','".$ex["code_barres"]."')"; - if($controle[$ex["id_bib"]]>0) + if($controle[$ex["id_bib"]]>0) $html.= sprintf('<img src="%s" border="0" title="%s" style="cursor:pointer" onclick="%s" alt="%s" />', URL_ADMIN_IMG.'picto/localisation.png', $this->_('Situer cet exemplaire dans la bibliothèque'), $onclick, $this->_('Situer en exemplaire')); - else + else $html.=' '; $html.='</td>'; } @@ -114,7 +115,7 @@ class ZendAfi_View_Helper_Notice_Exemplaires extends Zend_View_Helper_HtmlElemen if($preferences["plan"]==1) { $html.='<td class="gmap" style="text-align:center;">'; - if($bib["GOOGLE_MAP"] > "") + if($bib["GOOGLE_MAP"] > "") $html .= sprintf('<a href="%s"><img src="%s" border="0" alt="%s" title="%s" /></a>', BASE_URL.'/bib/mapview?id_bib='.$ex["id_bib"].'&retour=notice', URL_ADMIN_IMG.'picto/map.gif', @@ -159,7 +160,7 @@ class ZendAfi_View_Helper_Notice_Exemplaires extends Zend_View_Helper_HtmlElemen $html.='</div>'; $html.='<div class="exemplaires_oeuvre" style="display:none"><img src="'.URL_IMG.'patience.gif"></div>'; } - + // Pour afficher la localisation sur le plan $html.='<div id="plan_localisation" style="display:none"></div>'; @@ -190,7 +191,7 @@ class ZendAfi_View_Helper_Notice_Exemplaires extends Zend_View_Helper_HtmlElemen 'id_profil' => Class_Profil::getCurrentProfil()->getId()], null, true), - $this->view->tagImg(URL_ADMIN_IMG.'ico/edit.gif',['title' => $this->view->_('Modifier la configuration du tableau des exemplaires')]), + $this->view->tagImg(URL_ADMIN_IMG.'ico/edit.gif',['title' => $this->view->_('Modifier la configuration du tableau des exemplaires')]), ['data-popup' => 'true', 'style' => 'position: absolute']); } diff --git a/tests/application/modules/opac/controllers/NoticeAjaxControllerTest.php b/tests/application/modules/opac/controllers/NoticeAjaxControllerTest.php index 53dd4d9b9be17982ee62ab2c850c69ac9677b057..d49b1c3316c729698b94d0ef59d55ae8e0878bbd 100644 --- a/tests/application/modules/opac/controllers/NoticeAjaxControllerTest.php +++ b/tests/application/modules/opac/controllers/NoticeAjaxControllerTest.php @@ -440,7 +440,7 @@ class NoticeAjaxControllerExemplairesTest extends AbstractControllerTestCase { $mock_sql ->whenCalled('fetchAll') - ->with('Select id_notice,id_bib,cote,count(*) from exemplaires where id_notice=123 group by 1,2,3', + ->with('Select id_notice,id_bib,cote,count(*)id_int_bib_id_origine from exemplaires where id_notice=123 group by 1,2,3', false) ->answers($exemplaires); diff --git a/tests/library/Class/WebService/SIGB/CarthameTest.php b/tests/library/Class/WebService/SIGB/CarthameTest.php index d2e99611c43a6dc69e987c351a261dcfbd08c09c..b7e0705b463141e76f980e3a5e1331799823f071 100644 --- a/tests/library/Class/WebService/SIGB/CarthameTest.php +++ b/tests/library/Class/WebService/SIGB/CarthameTest.php @@ -16,7 +16,7 @@ * * 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 + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ abstract class CarthameTestCase extends Storm_Test_ModelTestCase { @@ -24,13 +24,17 @@ abstract class CarthameTestCase extends Storm_Test_ModelTestCase { Class_WebService_SIGB_Carthame::reset(); parent::tearDown(); } + public function setUp() { + parent::setUp(); + } } class CarthameGetServiceTest extends CarthameTestCase { + protected $service; public function setUp() { parent::setUp(); - $this->service = Class_WebService_SIGB_Carthame::getService(['url_serveur' => 'http://ifr.ro/webservices/index.php']); + $this->service = Class_WebService_SIGB_Carthame::getService(['url_serveur' => 'http://ifr.ro/webservices/index.php', 'key' => 'bibkey', 'sigb_field_name' => 'karvi']); } @@ -63,24 +67,67 @@ abstract class CarthameOperationTestCase extends CarthameTestCase { ->answers('') ->getWrapper(); - $this->service = Class_WebService_SIGB_Carthame::getService(['url_serveur' => 'http://ifr.ro/webservices/index.php']) + $this->service = Class_WebService_SIGB_Carthame::getService(['url_serveur' => 'http://ifr.ro/webservices/index.php', 'key' => 'bibkey', 'sigb_field_name' => 'karvi']) ->setWebClient($this->mock_web_client); } } -class CarthameNoticeAlbatorTest extends CarthameOperationTestCase { + +class CarthameKtmNoticeAlbatorTest extends CarthameTestCase { + protected $mock_web_client; + protected $service; + /** @var Class_WebService_SIGB_Notice */ protected $albator; public function setUp() { parent::setUp(); + $this->mock_web_client = Storm_Test_ObjectWrapper::on(new Class_WebService_SimpleWebClient()) + ->whenCalled('open_url') + ->answers('') + ->getWrapper(); $this->mock_web_client ->whenCalled('open_url') - ->with('http://ifr.ro/webservices/index.php?sigb=ktm&version=standalone&action=copyDetails&nn=I86355') + ->with('http://ifr.ro/webservices/index.php?sigb=ktm&version=standalone&idclient=bibkey&action=copyDetails&nn=I86355') ->answers(CarthameTestFixtures::createAnonymousNoticeXml()); + + + $this->service = Class_WebService_SIGB_Carthame::getService(['url_serveur' => 'http://ifr.ro/webservices/index.php', 'key' => 'bibkey']) + ->setWebClient($this->mock_web_client); + + $this->albator = $this->service->getNotice('I86355'); + } + + /** @test */ + public function shouldAnswerOneNotice() { + $this->assertInstanceOf('Class_WebService_SIGB_Notice', $this->albator); + } + + + /** @test */ + public function firstCopyGetDisponibiliteShouldReturnDisponible() { + $copies = $this->albator->getExemplaires(); + $this->assertEquals('Disponible', $copies[0]->getDisponibilite()); + } +} + + +class CarthameKarviNoticeAlbatorTest extends CarthameOperationTestCase { + /** @var Class_WebService_SIGB_Notice */ + protected $albator; + + public function setUp() { + parent::setUp(); + + $this->mock_web_client + ->whenCalled('open_url') + ->with('http://ifr.ro/webservices/index.php?sigb=karvi&version=standalone&idclient=bibkey&action=copyDetails&nn=I86355') + ->answers(CarthameTestFixtures::createAnonymousNoticeXml()) + ->beStrict(); + $this->albator = $this->service->getNotice('I86355'); } @@ -108,7 +155,7 @@ class CarthameAnonymousNoticeTest extends CarthameOperationTestCase { $this->mock_web_client ->whenCalled('open_url') - ->with('http://ifr.ro/webservices/index.php?sigb=ktm&version=standalone&action=copyDetails&nn=xxx') + ->with('http://ifr.ro/webservices/index.php?sigb=karvi&version=standalone&idclient=bibkey&action=copyDetails&nn=xxx') ->answers(CarthameTestFixtures::createAnonymousNoticeXml()); $this->anonymous = $this->service->getNotice('xxx'); @@ -213,10 +260,10 @@ class CarthameEmprunteurPatrickBTest extends CarthameOperationTestCase { $this->mock_web_client->whenCalled('open_url') - ->with('http://ifr.ro/webservices/index.php?sigb=ktm&version=standalone&action=login&username=pbarroca&password=1974') + ->with('http://ifr.ro/webservices/index.php?sigb=karvi&version=standalone&idclient=bibkey&action=login&username=pbarroca&password=1974') ->answers(CarthameTestFixtures::createEmprunteurPatrickBLoginXml()) ->whenCalled('open_url') - ->with('http://ifr.ro/webservices/index.php?sigb=ktm&version=standalone&action=accountDetails&userid=3') + ->with('http://ifr.ro/webservices/index.php?sigb=karvi&version=standalone&idclient=bibkey&action=accountDetails&userid=3') ->answers(CarthameTestFixtures::createEmprunteurPatrickBXml()) ; @@ -382,15 +429,15 @@ class CarthameOperationsTest extends CarthameOperationTestCase { public function reserverExemplaireShouldReturnSuccessIfNoError() { $this->mock_web_client ->whenCalled('open_url') - ->with('http://ifr.ro/webservices/index.php?sigb=ktm&version=standalone&action=login&username=pbarroca&password=1974') + ->with('http://ifr.ro/webservices/index.php?sigb=karvi&version=standalone&idclient=bibkey&action=login&username=pbarroca&password=1974') ->answers(CarthameTestFixtures::createEmprunteurPatrickBLoginXml()) - + ->whenCalled('open_url') - ->with('http://ifr.ro/webservices/index.php?sigb=ktm&version=standalone&action=reserveInfo&userid=3&nn=Millenium') + ->with('http://ifr.ro/webservices/index.php?sigb=karvi&version=standalone&idclient=bibkey&action=reserveInfo&userid=3&nn=Millenium') ->answers('<?xml version="1.0" encoding="utf-8"?> <root> <reservationInfo> - <sigb>KTM</sigb> + <sigb>KARVI</sigb> <user>16644</user> <nn>CL16028</nn> <site id="2" coche="luj-Napoca">=F</site> @@ -398,13 +445,13 @@ class CarthameOperationsTest extends CarthameOperationTestCase { <code>0</code> </reservationInfo> </root>') - + ->whenCalled('open_url') - ->with('http://ifr.ro/webservices/index.php?sigb=ktm&version=standalone&action=reserveDocument&userid=3&nn=Millenium&site=2') + ->with('http://ifr.ro/webservices/index.php?sigb=karvi&version=standalone&idclient=bibkey&action=reserveDocument&userid=3&nn=Millenium&site=2') ->answers('<?xml version="1.0"?> <root> <reservationDoc> - <sigb>ktm</sigb> + <sigb>karvi</sigb> <user>xxx</user> <nn>Millenium</nn> <infores>Millenium</infores> @@ -426,15 +473,15 @@ class CarthameOperationsTest extends CarthameOperationTestCase { public function reserverExemplaireInAnNotAllowedSiteShouldReturnAvailableSites() { $this->mock_web_client ->whenCalled('open_url') - ->with('http://ifr.ro/webservices/index.php?sigb=ktm&version=standalone&action=login&username=pbarroca&password=1974') + ->with('http://ifr.ro/webservices/index.php?sigb=karvi&version=standalone&idclient=bibkey&action=login&username=pbarroca&password=1974') ->answers(CarthameTestFixtures::createEmprunteurPatrickBLoginXml()) - + ->whenCalled('open_url') - ->with('http://ifr.ro/webservices/index.php?sigb=ktm&version=standalone&action=reserveInfo&userid=3&nn=Millenium') + ->with('http://ifr.ro/webservices/index.php?sigb=karvi&version=standalone&idclient=bibkey&action=reserveInfo&userid=3&nn=Millenium') ->answers('<?xml version="1.0" encoding="utf-8"?> <root> <reservationInfo> - <sigb>KTM</sigb> + <sigb>KARVI</sigb> <user>16644</user> <nn>CL16028</nn> <site id="3" coche="Iasi">Iasi</site> @@ -445,7 +492,7 @@ class CarthameOperationsTest extends CarthameOperationTestCase { </root>'); $this->assertEquals( - ['statut' => false, + ['statut' => false, 'erreur' => 'Réservation impossible. Autorisée seulement sur Iasi,Timisoara'], $this->service->reserverExemplaire($this->_user, $this->_exemplaire_millenium, @@ -464,15 +511,15 @@ class CarthameOperationsTest extends CarthameOperationTestCase { public function assertReserveInfoMessageIs($code, $message) { $this->mock_web_client ->whenCalled('open_url') - ->with('http://ifr.ro/webservices/index.php?sigb=ktm&version=standalone&action=login&username=pbarroca&password=1974') + ->with('http://ifr.ro/webservices/index.php?sigb=karvi&version=standalone&idclient=bibkey&action=login&username=pbarroca&password=1974') ->answers(CarthameTestFixtures::createEmprunteurPatrickBLoginXml()) ->whenCalled('open_url') - ->with('http://ifr.ro/webservices/index.php?sigb=ktm&version=standalone&action=reserveInfo&userid=3&nn=Millenium') + ->with('http://ifr.ro/webservices/index.php?sigb=karvi&version=standalone&idclient=bibkey&action=reserveInfo&userid=3&nn=Millenium') ->answers('<?xml version="1.0"?> <root> <reservationInfo> - <sigb>ktm</sigb> + <sigb>karvi</sigb> <user>3</user> <nn>Millenium</nn> <error>1</error> @@ -484,7 +531,7 @@ class CarthameOperationsTest extends CarthameOperationTestCase { $this->assertEquals( ['statut' => false, 'erreur' => $message], - $this->service->reserverExemplaire($this->_user, + $this->service->reserverExemplaire($this->_user, $this->_exemplaire_millenium, '1') ); } @@ -499,11 +546,11 @@ class CarthameOperationsTest extends CarthameOperationTestCase { /** @test */ public function supprimerReservationShouldReturnSuccessIfNoError() { $this->mock_web_client->whenCalled('open_url') - ->with('http://ifr.ro/webservices/index.php?sigb=ktm&version=standalone&action=reserveCancel&resid=MillRes') + ->with('http://ifr.ro/webservices/index.php?sigb=karvi&version=standalone&action=reserveCancel&resid=MillRes') ->answers('<?xml version="1.0"?> <root> <reservationCancel> - <sigb>KTM</sigb> + <sigb>KARVI</sigb> <resid>MillRes</resid> <error>0</error> <code></code> @@ -521,11 +568,11 @@ class CarthameOperationsTest extends CarthameOperationTestCase { /** @test */ public function supprimerReservationShouldReturnErrorIfFail() { $this->mock_web_client->whenCalled('open_url') - ->with('http://ifr.ro/webservices/index.php?sigb=ktm&version=standalone&action=reserveCancel&resid=HarrRes') + ->with('http://ifr.ro/webservices/index.php?sigb=karvi&version=standalone&idclient=bibkey&action=reserveCancel&resid=HarrRes') ->answers('<?xml version="1.0"?> <root> <reservationCancel> - <sigb>KTM</sigb> + <sigb>KARVI</sigb> <resid>HarrRes</resid> <error>-1</error> <code>Error from WS</code> @@ -542,11 +589,11 @@ class CarthameOperationsTest extends CarthameOperationTestCase { /** @test */ public function prolongerPretShouldReturnSuccessIfNoError() { $this->mock_web_client->whenCalled('open_url') - ->with('http://ifr.ro/webservices/index.php?sigb=ktm&version=standalone&action=prolongLoan&loanid=Millenium') + ->with('http://ifr.ro/webservices/index.php?sigb=karvi&version=standalone&idclient=bibkey&action=prolongLoan&loanid=Millenium') ->answers('<?xml version="1.0"?> <root> <prolongation> - <sigb>ktm</sigb> + <sigb>karvi</sigb> <id>Millenium</id> <error>0</error> <code>0</code> @@ -564,11 +611,11 @@ class CarthameOperationsTest extends CarthameOperationTestCase { /** @test */ public function prolongerPretShouldReturnErrorIfFail() { $this->mock_web_client->whenCalled('open_url') - ->with('http://ifr.ro/webservices/index.php?sigb=ktm&version=standalone&action=prolongLoan&loanid=095124224') + ->with('http://ifr.ro/webservices/index.php?sigb=karvi&version=standalone&idclient=bibkey&action=prolongLoan&loanid=095124224') ->answers('<?xml version="1.0"?> <root> <prolongation> - <sigb>ktm</sigb> + <sigb>karvi</sigb> <id>095124224</id> <error>1</error> <code>Error from WS</code> @@ -598,7 +645,8 @@ class CarthameKarviTest extends CarthameTestCase { $this->service = Class_WebService_SIGB_Carthame::getService( ['url_serveur' => 'http://ifr.ro/webservices/index.php', - 'key' => 'MyClientId']) + 'key' => 'MyClientId', + 'sigb_field_name' => 'karvi']) ->setWebClient($this->mock_web_client); $this->_user = Class_Users::newInstance() @@ -626,8 +674,8 @@ class CarthameKarviTest extends CarthameTestCase { /** @test */ public function reserverExemplaireRequestShouldContainMyClientId() { - $this->service->reserverExemplaire($this->_user, - $this->_exemplaire_millenium, + $this->service->reserverExemplaire($this->_user, + $this->_exemplaire_millenium, 'Institut F'); $this->assertQueryContains('MyClientId'); } @@ -724,7 +772,7 @@ class CarthameTestFixtures { return '<?xml version="1.0"?> <root> <login> - <sigb>ktm</sigb> + <sigb>karvi</sigb> <user>80001</user> <id>3</id> <email/>