Skip to content
Snippets Groups Projects
Commit cc62cb06 authored by efalcy's avatar efalcy
Browse files

Expoort EAD : indexation des type de docs par defaut

parent 20265e26
Branches
Tags
No related merge requests found
......@@ -95,8 +95,14 @@ class Class_EAD {
if ($this->_import_categorie->hasAlbums())
$this->_import_categorie->save();
foreach ($this->_albums as $album)
foreach ($this->_albums as $album) {
if ($type_doc=$album->getTypeDoc()) {
$album->setBibliotheques($type_doc->getBibliotheques());
$album->setAnnexes($type_doc->getAnnexes());
$album->setSections($type_doc->getSections());
}
$album->save();
}
return $this;
}
......
......@@ -488,4 +488,55 @@ class EADMoulinsTest extends PHPUnit_Framework_TestCase {
}
class EADIndexationParDefautTest extends Storm_Test_ModelTestCase {
public function setUp() {
parent::setUp();
Class_Album::beVolatile();
$codif_type_doc=self::fixture('Class_CodifTypeDoc', ['id' => Class_TypeDoc::LIVRE_NUM,
'famille_id' => Class_CodifTypeDoc::INCONNU,
'bibliotheques' => '1;8',
'annexes' => '10;12',
'sections' => '18;19']);
self::fixture('Class_TypeDoc', ['id'=>Class_TypeDoc::LIVRE_NUM,
'codif_type_doc' => $codif_type_doc,
'label'=> 'Livre Numérique'
]);
$this->_ead = new Class_EAD();
$this->_ead->loadFile('./tests/fixtures/ead_moulins.xml');
}
/**
* @test
**/
public function albumShouldHaveBibSelected() {
$album = array_at(66, $this->_ead->getAlbums());
$this->assertEquals('1;8',$album->getBibliotheques());
}
/**
* @test
**/
public function albumShouldHaveAnnexesSelected() {
$album = array_at(66, $this->_ead->getAlbums());
$this->assertEquals('10;12',$album->getAnnexes());
}
/**
* @test
**/
public function albumShouldHaveSectionsSelected() {
$album = array_at(66, $this->_ead->getAlbums());
$this->assertEquals('18;19',$album->getSections());
}
}
?>
\ 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