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

fix negative

parent 7acf4ce4
Branches
Tags
1 merge request!2723Master
Pipeline #4521 passed with stage
in 52 minutes and 56 seconds
......@@ -199,7 +199,7 @@ class Class_CodifDewey extends Storm_Model_Abstract {
$libelle = parent::_get('libelle');
return $libelle
? $libelle
: $this->formatIndice($this->getId());
: (string) $this->formatIndice($this->getIdDewey());
}
......
......@@ -165,7 +165,7 @@ class Class_CodifPcdm4 extends Storm_Model_Abstract {
$libelle = parent::_get('libelle');
return $libelle
? $libelle
: $this->formatIndice($this->getId());
: (string)$this->formatIndice($this->getIdPcdm4());
}
......
......@@ -242,3 +242,25 @@ class CodificationBrowserLibrarySimpleIndexTest extends CodificationBrowserSimpl
$_model = 'Class_Bib',
$_attribs = ['id' => 5, 'libelle' => 'Annecy'];
}
class CodificationBrowserFormatedLabelTest extends ModelTestCase {
protected $_storm_default_to_volatile = true;
/** @test */
public function newDeweyLabelShouldNotBeNull() {
$dewey = Class_CodifDewey::newInstance(['id_dewey' => '37889',
'libelle' => '']);
$this->assertEquals('378.89', $dewey->getLibelle());
}
/** @test */
public function newPcdm4LabelShouldNotBeNull() {
$pcdm4 = Class_CodifPcdm4::newInstance(['id_pcdm4' => '888448',
'libelle' => '']);
$this->assertEquals('8.88448', $pcdm4->getLibelle());
}
}
\ 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