Skip to content
Snippets Groups Projects
Commit cdd3ed5f authored by Patrick Barroca's avatar Patrick Barroca :grin:
Browse files

Merge branch 'hotline#13321-read-loan-library-from-koha-ilsdi' into 'hotline_6.42'

Hotline#13321 Read Loan Library From Koha Ilsdi
parents dee8c818 d2eb66da
Branches
Tags
5 merge requests!258Dev/13872 Orphee Allow Hold Available Items,!103Master,!100Master,!93Master,!92Hotline 6.42
......@@ -54,6 +54,16 @@ class Class_WebService_SIGB_Koha_PatronInfoReader extends Class_WebService_SIGB_
if ($this->_xml_parser->inParents('hold'))
$this->_current_operation->setId($id)->setNoNotice($id);
}
public function endHoldingbranch($data) {
$data = trim($data);
if (!$this->_currentLoan || !$data
|| !($site = Class_CodifAnnexe::findFirstBy(['code' => $data])))
return;
$this->_current_operation->getExemplaire()->setBibliotheque($site->getLibelle());
}
}
?>
\ No newline at end of file
......@@ -52,6 +52,7 @@ class KohaGetServiceTest extends PHPUnit_Framework_TestCase {
abstract class KohaTestCase extends PHPUnit_Framework_TestCase {
use Storm_Test_THelpers;
protected $mock_web_client;
protected $service;
......@@ -417,82 +418,99 @@ class KohaGetEmprunteurJeanAndreWithIdSIGBTest extends KohaTestCase {
->will($this->returnValue(KohaFixtures::xmlGetPatronInfoJeanAndre()));
$this->jean = $this->service->getEmprunteur(
Class_Users::newInstanceWithId(43, ['login' => 'JEAN',
'password' => 'zork',
'id_sigb' => '01234']));
$this->fixture('Class_Users', ['id' => 43,
'login' => 'JEAN',
'password' => 'zork',
'id_sigb' => '01234']));
$this->fixture('Class_CodifAnnexe', ['id' => 33,
'libelle' => 'Testing branch',
'code' => 'BIB']);
Class_Exemplaire::beVolatile();
Class_Notice::beVolatile();
}
/** @test */
function idShouldBe419() {
public function idShouldBe419() {
$this->assertEquals(419, $this->jean->getId());
}
/** @test */
function prenomShouldBeJeanAndre() {
public function prenomShouldBeJeanAndre() {
$this->assertEquals('Jean-André', $this->jean->getPrenom());
}
/** @test */
function nbEmpruntsShouldBeTwo() {
public function nbEmpruntsShouldBeTwo() {
$this->assertEquals(2, $this->jean->getNbEmprunts());
}
/** @test */
function nbReservationsShouldReturnZero() {
public function nbReservationsShouldReturnZero() {
$this->assertEquals(0, $this->jean->getNbReservations());
}
/** @test */
function firstEmpruntTitreShouldBeLaGuitareEn10Lecons() {
$this->assertEquals("La guitare en 10 leçons", $this->jean->getEmpruntAt(0)->getTitre());
public function firstEmpruntTitreShouldBeLaGuitareEn10Lecons() {
$this->assertEquals('La guitare en 10 leçons',
$this->jean->getEmpruntAt(0)->getTitre());
}
/** @test */
function firstEmpruntDateRetourShouldBe18_04_2009() {
public function firstEmpruntDateRetourShouldBe18_04_2009() {
$this->assertEquals('18/04/2009', $this->jean->getEmpruntAt(0)->getDateRetour());
}
/** @test */
function firstEmpruntCodeBorreShouldBe2700017UUU() {
public function firstEmpruntCodeBorreShouldBe2700017UUU() {
$this->assertEquals('2700017UUU', $this->jean->getEmpruntAt(0)->getCodeBarre());
}
/** @test */
function secondEmpruntTitreShouldBeLIleAuTresor() {
$this->assertEquals("L'Île au trésor", $this->jean->getEmpruntAt(1)->getTitre());
public function firstEmpruntLibraryShouldBeTestingBranch() {
$this->assertEquals('Testing branch',
$this->jean->getEmpruntAt(0)->getBibliotheque());
}
/** @test */
function secondEmpruntIdShouldBe4454() {
$this->assertEquals("4454", $this->jean->getEmpruntAt(1)->getId());
public function secondEmpruntTitreShouldBeLIleAuTresor() {
$this->assertEquals('L\'Île au trésor', $this->jean->getEmpruntAt(1)->getTitre());
}
/** @test */
function secondEmpruntExemplaireIdShouldBe4454() {
$this->assertEquals("4454", $this->jean->getEmpruntAt(1)->getExemplaire()->getId());
public function secondEmpruntIdShouldBe4454() {
$this->assertEquals('4454', $this->jean->getEmpruntAt(1)->getId());
}
/** @test */
function secondEmpruntAuteurShouldBeRobertLouisStevenson() {
$this->assertEquals("Robert Louis Stevenson", $this->jean->getEmpruntAt(1)->getAuteur());
public function secondEmpruntExemplaireIdShouldBe4454() {
$this->assertEquals('4454', $this->jean->getEmpruntAt(1)->getExemplaire()->getId());
}
/** @test */
function secondEmpruntDateDueShouldBe06052009() {
$this->assertEquals('06/05/2009', $this->jean->getEmpruntAt(1)->getDateRetour());
/** @test */
public function secondEmpruntAuteurShouldBeRobertLouisStevenson() {
$this->assertEquals('Robert Louis Stevenson',
$this->jean->getEmpruntAt(1)->getAuteur());
}
/** @test */
public function secondEmpruntDateDueShouldBe06052009() {
$this->assertEquals('06/05/2009', $this->jean->getEmpruntAt(1)->getDateRetour());
}
}
......
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