Skip to content
Snippets Groups Projects
Commit a4173c13 authored by Matthias Meusburger's avatar Matthias Meusburger
Browse files

dev #21441 : add custom field on sitotheque form

parent b0753708
Branches
Tags
5 merge requests!1132Hotline#29412 images des articles dans le resultat de recherche,!1120Master,!1069Dev#25302 add custom fields to sitos,!1055Dev#25302 add custom fields to sitos,!1054Dev#21441 add custom fields to sitos
......@@ -139,7 +139,7 @@ class Admin_SitoController extends ZendAfi_Controller_Action {
)
),
array(
'url' => $this->_getUrlForActionAndIdName('sitoadd', 'id_cat'),
'url' => $this->_getUrlForActionAndIdName('add', 'id_cat'),
'icon' => 'ico/add_news.gif',
'label' => 'Ajouter un site',
),
......
......@@ -26,7 +26,7 @@ class Class_CustomField_ModelConfiguration_Sitotheque extends Class_CustomField_
$this->_label = $this->_('Sitotheque');
$this->_edit_url = [
'module' => 'admin',
'controller' => 'cms',
'controller' => 'sito',
'action' => 'edit'];
}
}
......
......@@ -25,7 +25,7 @@ abstract class SitothequeControllerTestCase extends Admin_AbstractControllerTest
public function setUp() {
parent::setUp();
$this->setupCustomFields();
$this->setupDomaines();
Class_Exemplaire::beVolatile();
Class_Notice::beVolatile();
......@@ -59,6 +59,20 @@ abstract class SitothequeControllerTestCase extends Admin_AbstractControllerTest
Class_Bib::getPortail()->setSitothequeCategories([]);
}
public function setupCustomFields() {
Class_CustomField_Meta::beVolatile();
$theme = $this->fixture('Class_CustomField',
['id' => 2,
'priority' => 3,
'label' => 'Theme',
'field_type' => Class_CustomField_Meta::SELECT,
'options_list' => 'web links;livres',
'model' => 'Sitotheque']);
}
public function tearDown() {
Storm_Model_Loader::defaultToDb();
parent::tearDown();
......@@ -193,6 +207,13 @@ class SitothequeControllerSitoEditTest extends SitothequeControllerTestCase {
public function checkBoxShouldCheckedDomaineArt() {
$this->assertXPath("//input[@name='domaine_ids'][@value='10']");
}
/** @test */
public function customFieldShouldBeDisplayed() {
$this->assertXPathContentContains('//select[@id="field_2"]//option', 'web links', $this->_response->getBody());
}
}
......@@ -235,6 +256,13 @@ class SitothequeControllerAddActionTest extends SitothequeControllerTestCase {
public function checkBoxShouldCheckedDomaineInformations() {
$this->assertXPath("//input[@name='domaine_ids'][@value='66']",$this->_response->getBody());
}
/** @test */
public function customFieldShouldBeDisplayed() {
$this->assertXPathContentContains('//select[@id="field_2"]//option', 'web links', $this->_response->getBody());
}
}
......@@ -295,6 +323,7 @@ class SitothequeControllerPostAddActionTest extends SitothequeControllerTestCase
public function cacheShouldHaveBeenCleaned() {
$this->assertTrue($this->cache->methodHasBeenCalled('clean'));
}
}
......@@ -336,6 +365,8 @@ class SitothequeControllerSitoPostEditLeMondeTest extends SitothequeControllerTe
public function anwersShouldRedirectToSitoEdit23() {
$this->assertRedirectTo('/admin/sito/edit/id/23');
}
}
......
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