From 03ecc8257f17fdba4a8361f973665ebb5061aaa1 Mon Sep 17 00:00:00 2001
From: llaffont <llaffont@git-test.afi-sa.fr>
Date: Fri, 21 Sep 2012 10:50:38 +0000
Subject: [PATCH] =?UTF-8?q?Alo=C3=A8s:=20prise=20en=20compte=20libell?=
 =?UTF-8?q?=C3=A9=20"Biblioth=C3=A8que"=20pour=20la=20localisation=20des?=
 =?UTF-8?q?=20exemplaires=20dans=20la=20liste=20des=20pr=C3=AAts?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 categories.org                                      |  7 ++++---
 .../Class/WebService/SIGB/ExemplaireOperation.php   |  2 +-
 library/Class/WebService/SIGB/Opsys/Service.php     |  1 +
 .../Class/WebService/SIGB/OpsysServiceTest.php      | 13 ++++++++++++-
 4 files changed, 18 insertions(+), 5 deletions(-)

diff --git a/categories.org b/categories.org
index ca1488e7bd5..4b73fcc09dc 100644
--- a/categories.org
+++ b/categories.org
@@ -49,9 +49,7 @@ cf [[file:application/modules/opac/controllers/AbonneController.php::and%20null%
 		 CLOSED: [2012-08-20 Mon 17:39]
 
 *** [[file:tests/application/modules/opac/controllers/AbonneControllerMultimediaTest.php::class%20AbonneControllerMultimediaHoldConfirmTest%20extends%20AbonneControllerMultimediaHoldTestCase%20{][5ème écran confirmation]]
-** TODO Fiche abonné: afficher conso + temps restant par jour / semaine / mois
-** DONE Skin réservation timeline 
-	 CLOSED: [2012-08-11 Sat 14:14]
+** Skin réservation timeline 
 	[[http://localhost/afi-opac3/abonne/multimedia-hold-location][url page réservation]]
 	[[file:public/opac/css/global.css::.timeline%20{][CSS .timeline]]
 	[[file:application/modules/opac/views/scripts/abonne/multimedia-hold-location.phtml::<?php%20foreach%20($this->locations%20as%20$location)%20{%20?][vue réservation]]
@@ -74,6 +72,9 @@ cf [[file:application/modules/opac/controllers/AbonneController.php::and%20null%
 	 [[file:tests/library/Class/WebService/SIGB/MicrobibServiceTest.php::$this->emprunteur%20%3D%20$this->_microbib->getEmprunteur(Class_Users::getLoader()][Tests getEmprunteur]]
 
 
+* WS Opsys
+** [[file:library/Class/WebService/SIGB/Opsys/Service.php::class%20Class_WebService_SIGB_Opsys_Service%20extends%20Class_WebService_SIGB_AbstractService%20{][Opsys_Service]]
+** [[file:tests/library/Class/WebService/SIGB/OpsysServiceTest.php::abstract%20class%20OpsysServiceFactoryWithCatalogueWebTestCase%20extends%20PHPUnit_Framework_TestCase%20{][Test Opsys]]
 
 * Scaffolding avec ZendAfi
 	[[file:application/modules/admin/controllers/OaiController.php::public%20function%20getRessourceDefinitions()%20{][Exemple de définition de ressources dans l'OAI controller]]
diff --git a/library/Class/WebService/SIGB/ExemplaireOperation.php b/library/Class/WebService/SIGB/ExemplaireOperation.php
index 3f1e1ee98d0..06513d80650 100644
--- a/library/Class/WebService/SIGB/ExemplaireOperation.php
+++ b/library/Class/WebService/SIGB/ExemplaireOperation.php
@@ -215,7 +215,7 @@ abstract class Class_WebService_SIGB_ExemplaireOperation {
 	public function parseExtraAttributes($attributes) {
 		$this->_attributes = $attributes;
 
-		$this->_exemplaire->setBibliotheque($this->getAttribute('Bibliotheque'));
+		$this->_exemplaire->setBibliotheque($this->getAttribute('Biblio'));
 		$this->_exemplaire->setSection($this->getAttribute('Section'));
 		$this->_exemplaire->setAuteur($this->getAttribute('Auteur'));
 		$this->_exemplaire->setNoNotice($this->getAttribute('N° de notice'));
diff --git a/library/Class/WebService/SIGB/Opsys/Service.php b/library/Class/WebService/SIGB/Opsys/Service.php
index 3341ffaa3f4..778dc8bf06f 100644
--- a/library/Class/WebService/SIGB/Opsys/Service.php
+++ b/library/Class/WebService/SIGB/Opsys/Service.php
@@ -87,6 +87,7 @@ class Class_WebService_SIGB_Opsys_Service extends Class_WebService_SIGB_Abstract
 
 
 	public function getEmpruntsOf($emprunteur) {
+		xdebug_break();
 		// prets pas en retard
 		$liste_prets_result = $this->search_client->EmprListerEntite(
 																					EmprListerEntite::prets($this->guid));
diff --git a/tests/library/Class/WebService/SIGB/OpsysServiceTest.php b/tests/library/Class/WebService/SIGB/OpsysServiceTest.php
index 6f8ec2224e9..5300e9684ba 100644
--- a/tests/library/Class/WebService/SIGB/OpsysServiceTest.php
+++ b/tests/library/Class/WebService/SIGB/OpsysServiceTest.php
@@ -1004,7 +1004,7 @@ class EmpruntFixtures {
 																			 'Dateretourprevue' => '21/10/2010',
 																			 'Section' => 'Espace jeunesse',
 																			 'Auteur' => 'Lewis Caroll',
-																			 'Bibliotheque' => 'Astrolabe',
+																			 'Bibliothèque' => 'Astrolabe',
 																			 'N° de notice' => '5678'));
 		return $alice;
 	}
@@ -1121,11 +1121,22 @@ class OpsysServiceEmpruntTestSort extends PHPUnit_Framework_TestCase {
 		$this->emprunteur->setService($this->opsys_service);
 	}
 
+
 	public function testOrderEmprunt(){
 		$this->assertEquals($this->emprunteur->getEmpruntAt(0)->getTitre(), 'Alice');
 		$this->assertEquals($this->emprunteur->getEmpruntAt(1)->getTitre(), 'Cendrillon');
 		$this->assertEquals($this->emprunteur->getEmpruntAt(2)->getTitre(), 'Potter');
 	}
+
+	/** @test */
+	public function cendrillonBibliothequeShouldBeAstrolabe() {
+		$this->assertEquals('Astrolabe', $this->emprunteur->getEmpruntAt(1)->getBibliotheque());
+	}
+
+	/** @test */
+	public function aliceBibliothequeShouldBeAstrolabe() {
+		$this->assertEquals('Astrolabe', $this->emprunteur->getEmpruntAt(0)->getBibliotheque());
+	}
 }
 
 
-- 
GitLab