Skip to content
Snippets Groups Projects
Commit ad2a37a5 authored by Sebastien ANDRE's avatar Sebastien ANDRE
Browse files

hotline : #145301 : registered add option empty

parent e75c8392
1 merge request!4521hotline : #145301 : registered add option empty
Pipeline #18150 passed with stage
in 20 minutes and 6 seconds
- correctif #145301 : Préinscription : Sélection des sites rajouter une zone blanche par défaut et rendre la zone obligatoire
\ No newline at end of file
......@@ -21,8 +21,10 @@
class ZendAfi_Form_PreRegistration_Nanook extends ZendAfi_Form {
public function init() {
parent::init();
$start = date("Y-m-d", strtotime('-150 year'));
$end = date("Y-m-d", strtotime('now'));
......@@ -30,7 +32,9 @@ class ZendAfi_Form_PreRegistration_Nanook extends ZendAfi_Form {
->addElement('select',
'site',
['label' => $this->_('Médiathèque'),
'multiOptions' => Class_IntBib::findAllNanookLabelsWithPreRegistration()])
'multiOptions' => ['' => ''] + Class_IntBib::findAllNanookLabelsWithPreRegistration(),
'required' => true,
'allowEmpty' => false])
->addElement('text',
'lastName',
......
......@@ -33,7 +33,7 @@ class TemplatesAuthPreRegisterActionDispatchTest extends AbstractControllerTestC
ZendAfi_Auth::getInstance()->clearIdentity();
$this->fixture('Class_IntBib',
$this->fixture(Class_IntBib::class,
['id' => 1,
'comm_params' => ['url_serveur' => 'http://super.nano.ok/ilsdi/arcadia',
'pre-registration' => 1],
......@@ -47,12 +47,26 @@ class TemplatesAuthPreRegisterActionDispatchTest extends AbstractControllerTestC
public function pageShouldContainsParagrahWithGoAndRegisterToMyLibrary() {
$this->assertXPath('//p[@class="help_message"][contains(text(), "Go and register")]/br');
}
/** @test */
public function pageShouldContainsLabelMediathequeRequired() {
$this->assertXPath('//label[@class="required col-12 col-sm-5 col-form-label col-form-label-sm pr-1"][text()="Médiathèque"]');
}
/** @test */
public function pageShouldContainsSelectSiteWithEmptyOptionAndOrdered() {
$this->assertXPath('//select[@class="zendafi_form_preregistration_nanook_site form-control form-control-sm custom-select custom-select-sm"][@required="required"]/option[not(text())]');
$this->assertXPath('//select[@class="zendafi_form_preregistration_nanook_site form-control form-control-sm custom-select custom-select-sm"][@required="required"]/option[@label="Tombouctou"][@value="1"][text()="Tombouctou"][1]');
}
}
class TemplatesAuthPreRegisterAdminEditActionDispatchTest extends Admin_AbstractControllerTestCase {
class TemplatesAuthPreRegisterAdminEditActionDispatchTest
extends Admin_AbstractControllerTestCase {
public function setUp() {
parent::setUp();
......@@ -63,4 +77,4 @@ class TemplatesAuthPreRegisterAdminEditActionDispatchTest extends Admin_Abstract
public function configFormShouldContainsTextAreaHelpMessage() {
$this->assertXPath('//form//textarea[@name="help_message"]');
}
}
\ 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