From 26a71400fd2302c563f942167bdfbb8bbcb7a27e Mon Sep 17 00:00:00 2001
From: Ghislain Loas <ghislo@sandbox.pergame.net>
Date: Fri, 22 Jan 2016 13:59:06 +0100
Subject: [PATCH] hotline #36925 add tests

---
 library/ZendAfi/Form/Admin/User.php                   |  3 +--
 .../modules/admin/controllers/UsersControllerTest.php | 11 +++++++++++
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/library/ZendAfi/Form/Admin/User.php b/library/ZendAfi/Form/Admin/User.php
index a5976dea7a7..5d87321eea1 100644
--- a/library/ZendAfi/Form/Admin/User.php
+++ b/library/ZendAfi/Form/Admin/User.php
@@ -123,8 +123,7 @@ class ZendAfi_Form_Admin_User extends ZendAfi_Form {
       ->addElement('select',
                    'role_level',
                    array_merge(['label' => $this->_('Niveau d\'accès'),
-                                'multiOptions' => $multi_options],$option));
-    $this
+                                'multiOptions' => $multi_options],$option))
       ->addElement('select',
                    'id_site',
                    array_merge(
diff --git a/tests/application/modules/admin/controllers/UsersControllerTest.php b/tests/application/modules/admin/controllers/UsersControllerTest.php
index e3996c22305..6ef88ef119b 100644
--- a/tests/application/modules/admin/controllers/UsersControllerTest.php
+++ b/tests/application/modules/admin/controllers/UsersControllerTest.php
@@ -607,6 +607,11 @@ class UsersControllerAddViewTest extends AbstractControllerTestCase {
   public function testPseudoIsEmpty() {
     $this->assertXPath("//input[@name='pseudo'][@value='']");
   }
+
+  /** @test */
+  public function idSiteSelectorShouldNotBeDisabled() {
+    $this->assertNotXPath('//form//select[@id="id_site"][@disabled]');
+  }
 }
 
 
@@ -824,6 +829,12 @@ class Admin_UsersControllerFormEditAdminTest extends Admin_UsersControllerEditAd
   }
 
 
+  /** @test */
+  public function libACSHouldBeSelected() {
+    $this->assertXPathContentContains('//fieldset//table//tr//td//select[@name="id_site"]//option[@value="1"][@selected]', 'AC');
+  }
+
+
   /** @test */
   public function roleLevelSuperShouldNotBePresent() {
     $this->assertNotXPath('//fieldset//table//tr//td//select[@name="role_level"]//option[@value="7"]');
-- 
GitLab