Skip to content
Snippets Groups Projects
Commit cae9c52b authored by pbarroca's avatar pbarroca
Browse files

Ajout bibliothèques, annexes, section dans l'édition d'un album

parent 82a497f0
Branches
Tags
No related merge requests found
......@@ -125,7 +125,10 @@ class Class_Album extends Storm_Model_Abstract {
'notes' => '',
'visible' => true,
'droits' => '',
'nature_doc' => '');
'nature_doc' => '',
'bibliotheques' => '',
'annexes' => '',
'sections' => '');
/** @var Class_Upload */
protected $_uploadHandler;
......
......@@ -207,13 +207,16 @@ class ZendAfi_Form_Album extends ZendAfi_Form {
->addElement('cochesSuggestion', 'bibliotheques',
['label' => 'Bibliotheques',
'name' => 'bibliotheques',
'rubrique' => 'bibliotheque'])
'rubrique' => 'bibliotheque',
'value' => $album->getBibliotheques()])
->addElement('cochesSuggestion', 'annexes', ['label' => 'Sites',
'name' => 'annexes',
'rubrique' => 'annexe'])
'name' => 'annexes',
'rubrique' => 'annexe',
'value' => $album->getAnnexes()])
->addElement('cochesSuggestion', 'sections', ['label' => 'Sections',
'name' => 'sections',
'rubrique' => 'section']);
'name' => 'sections',
'rubrique' => 'section',
'value' => $album->getSections()]);
;
......
......@@ -100,6 +100,12 @@ abstract class Admin_AlbumControllerTestCase extends Admin_AbstractControllerTes
->setCategorie($adulte)
->save();
}
public function tearDown() {
Class_Album::setTimeSource(null);
parent::tearDown();
}
}
......@@ -745,7 +751,11 @@ class Admin_AlbumControllerPostAlbumWithoutTitreToPatrimoineTest extends Admin_A
class Admin_AlbumControllerEditAlbumMesBDTest extends Admin_AlbumControllerTestCase {
public function setUp() {
parent::setUp();
Class_Album::find(43)->setCatId(2);
Class_Album::find(43)
->setCatId(2)
->setBibliotheques('74')
->setAnnexes('73;93')
->setSections('42');
$this->dispatch('/admin/album/edit_album/id/43');
}
......@@ -907,9 +917,22 @@ class Admin_AlbumControllerEditAlbumMesBDTest extends Admin_AlbumControllerTestC
$this->assertXPath('//div[contains(@onclick, "admin/album/index/id/43/cat_id/2")]');
}
/** @test */
public function bibAffichageShouldBeDisplayed() {
$this->assertXPath("//input[@name='bibliotheques']");
$this->assertXPath("//input[@name='bibliotheques'][@value='74']");
}
/** @test */
public function annexesAffichageShouldBeDisplayed() {
$this->assertXPath("//input[@name='annexes'][@value='73;93']");
}
/** @test */
public function sectionsAffichageShouldBeDisplayed() {
$this->assertXPath("//input[@name='sections'][@value='42']");
}
}
......@@ -959,7 +982,8 @@ class Admin_AlbumControllerPostEditAlbumMesBDTest extends Admin_AlbumControllerT
'dewey' => '15',
'genre' => '12',
'cote' => 'MS003',
'provenance' => 'Annecy');
'provenance' => 'Annecy',
'bibliotheques' => '1;23;7');
$this
->getRequest()
......@@ -1046,6 +1070,12 @@ class Admin_AlbumControllerPostEditAlbumMesBDTest extends Admin_AlbumControllerT
public function provenanceShouldBeAnnecy() {
$this->assertEquals('Annecy', $this->bd->getProvenance());
}
/** @test */
public function bibliothequesShouldBeUpdated() {
$this->assertEquals('1;23;7', $this->bd->getBibliotheques());
}
}
......@@ -1683,19 +1713,6 @@ class Admin_AlbumControllerPreviewAlbumBibleSouvignyPostTest extends Admin_Album
class Admin_AlbumControllerPreviewAlbumBibleSouvignyPostWrongDataTest extends Admin_AlbumControllerTestCase {
public function setUp() {
parent::setUp();
$this->postDispatch('/admin/album/preview_album/id/44',
array('thumbnail_right_page_crop_right' => 'zork'));
}
}
class Admin_AlbumControllerImportEADTest extends Admin_AlbumControllerTestCase {
public function setUp() {
parent::setUp();
......
......@@ -165,7 +165,10 @@ class AlbumHarlockBasicTest extends AlbumHarlockTestCase {
'droits' => '',
'nature_doc' => '',
'nature_doc_ids' => [],
'cat_id' => 0],
'cat_id' => 0,
'bibliotheques' => '',
'annexes' => '',
'sections' => ''],
$this->_album->toArray());
}
......
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