Skip to content
Snippets Groups Projects
Commit 282218a4 authored by Arthur Suzuki's avatar Arthur Suzuki
Browse files

fix isCommKoha() in Class_IntBib

parent f25331bb
1 merge request!4849fix isCommKoha() in Class_IntBib
Pipeline #26780 passed with stage
in 43 minutes and 13 seconds
......@@ -569,7 +569,7 @@ class Class_IntBib extends Storm_Model_Abstract {
public function isCommKoha() {
return $this->getCommSigb() == (static::COM_KOHA || static::COM_KOHA_LEGACY);
return in_array($this->getCommSigb(), [static::COM_KOHA, static::COM_KOHA_LEGACY]);
}
......
......@@ -99,8 +99,43 @@ class IntBibSingleNanookTest extends ModelTestCase {
}
/** @test */
public function shouldNotBeCommKoha() {
$this->assertFalse(Class_IntBib::find(78)->isCommKoha());
}
/** @test */
public function shouldBeSingleNanookPatrons() {
$this->assertTrue(Class_IntBib::isSingleNanookPatrons());
}
}
\ No newline at end of file
}
class IntBibKohaTest extends ModelTestCase {
public function setUp() {
parent::setUp();
$this->fixture(Class_IntBib::class,
['id' => 78,
'sigb' => Class_IntBib::SIGB_KOHA,
'comm_sigb' => Class_IntBib::COM_KOHA,
'comm_params' => 'a:1:{s:11:"url_serveur";s:53:"http://nanookws.afi-sa.net/afi_NanookWs/ilsdi/meylan/";}']);
}
/** @test */
public function shouldBeCommKoha() {
$this->assertTrue(Class_IntBib::find(78)->isCommKoha());
}
/** @test */
public function shouldBeCommKohaAlsoWithLegacy() {
$int_bib = Class_IntBib::find(78);
$int_bib->setCommSigb(Class_IntBib::COM_KOHA_LEGACY);
$this->assertTrue($int_bib->isCommKoha());
}
}
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