Commit 40f018f2 by Patrick Barroca

Merge branch 'hotline-master' into 'master'

Hotline master

See merge request !2463
parents c8056eeb 27da3849
Pipeline #3263 failed with stage
in 26 minutes 17 seconds
08/01/2018 - v7.11.16
- ticket #66631: lorsque l'éditeur CSS est fermé, désactive l'ouverture automatique (bouton du menu d'administration)
- ticket #67041 : Boîte article : correction de la mise à jour des paramètres de la boîte en mode sélection lors de la création article depuis le front
- ticket #66056 : détails notices: décodages des responsabilités multiples lorsque seules les codifications sont fournies
- ticket #65274 : Lettres d'informations: mise à jour de la liste des domaines reconnus pour la validation des addresses mails
- ticket #68975 : Retour sur les articles en mode liste après sauvegarde : correction de retour sur la catégorie de l'article
- ticket #66995 : Groupes d'utilisateurs: correction du déplacements des groupes et des catégories
- ticket #69326 : correction patch de mise à jour des urls cite de la musique (pouvait créer des doublonns d'albums)
- ticket #66376 : Les dates d'ouvertures exceptionnelles s'affichent 30 jours avant la date de début, même si des périodes de validité se superposent
- ticket #68332 : lorsqu'un article est supprimé, correction de la suppression des valeurs des champs personnalisés associés
- ticket #65216 : Articles: sur modification du carousel, le bouton "Valider" est accessible
02/01/2018 - v7.11.15
- ticket #64820 : Connecteur Cité de la musique : prise en charge du nouveau serveur OAI
......
......@@ -732,19 +732,18 @@ smalltalk.addMethod(
"_close",
smalltalk.method({
selector: "close",
fn: function () {
var self = this;
if (smalltalk.assert(self['@opened'])) {
smalltalk.send(smalltalk.send("#amber", "_asJQuery", []), "_hide", []);
smalltalk.send(smalltalk.send(self['@ul'], "_asJQuery", []), "_hide", []);
smalltalk.send(self['@selectedTab'], "_hide", []);
smalltalk.send(self, "_removeBodyMargin", []);
smalltalk.send(smalltalk.send("body", "_asJQuery", []), "_removeClass_", ["amberBody"]);
self['@opened'] = false;
self['@opened'];
}
return self;
}
fn: function(){
var self=this;
if(smalltalk.assert(self["@opened"])){
smalltalk.send(smalltalk.send(smalltalk.send("#amber","_asJQuery",[]),"_hide",[]),"_trigger_",["hide"]);
smalltalk.send(smalltalk.send(self["@ul"],"_asJQuery",[]),"_hide",[]);
smalltalk.send(self["@selectedTab"],"_hide",[]);
smalltalk.send(self,"_removeBodyMargin",[]);
smalltalk.send(smalltalk.send("body","_asJQuery",[]),"_removeClass_",["amberBody"]);
self["@opened"]=false;
self["@opened"];
};
return self}
}),
smalltalk.TabManager);
......
......@@ -983,22 +983,21 @@ smalltalk.addMethod(
smalltalk.method({
selector: "close",
category: 'actions',
fn: function () {
var self = this;
if (smalltalk.assert(self['@opened'])) {
smalltalk.send(smalltalk.send("#amber", "_asJQuery", []), "_hide", []);
smalltalk.send(smalltalk.send(self['@ul'], "_asJQuery", []), "_hide", []);
smalltalk.send(self['@selectedTab'], "_hide", []);
smalltalk.send(self, "_removeBodyMargin", []);
smalltalk.send(smalltalk.send("body", "_asJQuery", []), "_removeClass_", ["amberBody"]);
self['@opened'] = false;
self['@opened'];
}
return self;
},
fn: function(){
var self=this;
if(smalltalk.assert(self["@opened"])){
smalltalk.send(smalltalk.send(smalltalk.send("#amber","_asJQuery",[]),"_hide",[]),"_trigger_",["hide"]);
smalltalk.send(smalltalk.send(self["@ul"],"_asJQuery",[]),"_hide",[]);
smalltalk.send(self["@selectedTab"],"_hide",[]);
smalltalk.send(self,"_removeBodyMargin",[]);
smalltalk.send(smalltalk.send("body","_asJQuery",[]),"_removeClass_",["amberBody"]);
self["@opened"]=false;
self["@opened"];
};
return self},
args: [],
source: "close\x0a opened ifTrue: [\x0a\x09'#amber' asJQuery hide.\x0a\x09ul asJQuery hide.\x0a\x09selectedTab hide.\x0a\x09self removeBodyMargin.\x0a\x09'body' asJQuery removeClass: 'amberBody'.\x0a\x09opened := false]",
messageSends: ["ifTrue:", "hide", "asJQuery", "removeBodyMargin", "removeClass:"],
source: "close\x0a opened ifTrue: [\x0a\x09'#amber' asJQuery hide trigger: 'hide'.\x0a\x09ul asJQuery hide.\x0a\x09selectedTab hide.\x0a\x09self removeBodyMargin.\x0a\x09'body' asJQuery removeClass: 'amberBody'.\x0a\x09opened := false]",
messageSends: ["ifTrue:", "trigger:", "hide", "asJQuery", "removeBodyMargin", "removeClass:"],
referencedClasses: []
}),
smalltalk.TabManager);
......
......@@ -356,7 +356,7 @@ tabs
close
opened ifTrue: [
'#amber' asJQuery hide.
'#amber' asJQuery hide trigger: 'hide'.
ul asJQuery hide.
selectedTab hide.
self removeBodyMargin.
......
......@@ -67,7 +67,14 @@ class Admin_CmsController extends ZendAfi_Controller_Action {
$this->identity->isRoleLibraryLimited()
? $this->_bib->getId()
: null);
$id_cat = $this->_getParam('id_cat', 0);
$article = ($id_article = $this->_getParam('id', null))
? Class_Article::find($id_article)
: null;
$id_cat = $article
? $article->getIdCat()
: $this->_getParam('id_cat', 0);
$params = ['page' => $this->_getParam('page', 0),
'search_value' => $search,
......
......@@ -44,7 +44,7 @@ class Class_Migration_CiteDeLaMusiqueBecomesPhilharmonieDeParis {
protected function updateUrlOrigine() {
Zend_Db_Table::getDefaultAdapter()
->query('update album set url_origine="' . static::URL . '"');
->query('update album set url_origine="' . static::URL . '" where type_doc_id=' . Class_TypeDoc::CITEDELAMUSIQUE);
return $this;
}
......
......@@ -1221,7 +1221,9 @@ class Class_Notice extends Storm_Model_Abstract {
}
if ($item['code'] == '4') {
$fonctions []= $valeur;
$fonctions []= (is_numeric($valeur) && ($codif_fonction = Class_CodifAuteurFonction::find($valeur)))
? $codif_fonction->getLibelle()
: $valeur;
continue;
}
......@@ -1273,19 +1275,12 @@ class Class_Notice extends Storm_Model_Abstract {
$item = explode('|', $auteur);
$nom = $item[0];
$prenom = $item[1];
$fonction = $item[2];
$fonction_pergame = $item[3];
$fonction = $fonction_pergame ? $fonction_pergame : $item[2];
if (!$codif_auteur = Class_CodifAuteur::findByLastNameFirstName($nom, $prenom))
return [];
if ($fonction_pergame)
$fonction = $fonction_pergame;
else {
if ($auteur_fonction = Class_CodifAuteurFonction::find($fonction))
$fonction = $auteur_fonction->getLibelle();
}
$label = trim($prenom . ' ' . $nom) . (($fonction) ? ' (' . $fonction . ')': '');
return $this->getReboundFieldForFacet('A'.$codif_auteur->getId(),
$label,
......
......@@ -236,6 +236,17 @@ class Class_Ouverture extends Storm_Model_Abstract {
}
public function isValidDuring($from, $to) {
if ($this->isValidOnDate($from) || $this->isValidOnDate($to))
return true;
$time_start = strtotime($this->getValidityStart());
$time_end = strtotime($this->getValidityEnd());
return ($from <= $time_start && $time_end <= $to);
}
public function isExceptionalOpenOnDate($date) {
return $this->isExceptional()
&& (!$this->isClosure())
......
......@@ -118,8 +118,7 @@ class Class_Ouverture_Visitor {
return $now <= $opening_day && $now_plus_30 >= $opening_day;
}
return $opening->isValidOnDate($now)
|| $opening->isValidOnDate($now_plus_30);
return $opening->isValidDuring($now, $now_plus_30);
}
......
......@@ -76,10 +76,10 @@ abstract class Class_Systeme_Widget_Abstract extends Class_Entity {
protected function _getValues($attributes) {
return $this->_getWidgetResources()
->getValues(array_merge(isset($attributes['preferences'])
->getValues(array_merge($attributes,
isset($attributes['preferences'])
? $attributes['preferences']
: [],
$attributes));
: []));
}
......
......@@ -36,10 +36,13 @@ class UserGroupCategorieLoader extends Storm_Model_Loader{
public static function getUserGroupCategoriesLibelles() {
$categories= Class_UserGroupCategorie::getUserGroupCategories();
$libelles=[0 =>'Aucune'];
$libelles = [];
foreach ($categories as $categorie) {
$libelles[$categorie->getId()] = $categorie->getLibelle();
$libelles[$categorie->getId()] = implode(' > ', $categorie->getPathParts());
}
asort($libelles);
return $libelles;
}
}
......@@ -48,21 +51,25 @@ class UserGroupCategorieLoader extends Storm_Model_Loader{
class Class_UserGroupCategorie extends Storm_Model_Abstract {
use Trait_TreeViewableCategorie, Trait_Translator, Trait_TreeNode;
protected $_table_name = 'user_group_categorie';
protected $_loader_class = 'UserGroupCategorieLoader';
protected $_has_many = [ 'user_groups' => [ 'model' => 'Class_UserGroup',
'role' => 'categorie',
'order' => 'libelle',
'dependent' => 'delete' ],
'sous_categories' => ['model' => 'Class_UserGroupCategorie',
'role' => 'parent_categorie',
'order' => 'libelle',
'dependents' => 'delete'],
protected
$_table_name = 'user_group_categorie',
$_loader_class = 'UserGroupCategorieLoader',
$_has_many = [ 'user_groups' => [ 'model' => 'Class_UserGroup',
'role' => 'categorie',
'order' => 'libelle',
'dependent' => 'delete' ],
'sous_categories' => ['model' => 'Class_UserGroupCategorie',
'role' => 'parent_categorie',
'order' => 'libelle',
'dependents' => 'delete'],
];
],
protected $_belongs_to = ['parent_categorie' => ['model' => 'Class_UserGroupCategorie',
'referenced_in' => 'parent_id']];
$_belongs_to = ['parent_categorie' => ['model' => 'Class_UserGroupCategorie',
'referenced_in' => 'parent_id']],
$_default_attribute_values = ['parent_id' => 0];
/** [[file:~/public_html/afi-opac3/library/Trait/TreeNode.php::trait%20Trait_TreeNode%20{][voir Trait_TreeNode]] */
......@@ -94,4 +101,24 @@ class Class_UserGroupCategorie extends Storm_Model_Abstract {
public function getIdCatMere() {
return $this->getParentId();
}
public function validate() {
$this->checkAttribute('parent_id',
$this->_isParentCategoryNotCircular(),
$this->_('Référence circulaire'));
}
protected function _isParentCategoryNotCircular() {
$parent = Class_UserGroupCategorie::getLoader()->find($this->getParentId());
while($parent) {
if ($parent->getId() == $this->getId()) {
return false;
}
$parent = Class_UserGroupCategorie::getLoader()->find($parent->getParentId());
}
return true;
}
}
\ No newline at end of file
......@@ -94,6 +94,8 @@ class ZendAfi_Controller_Plugin_Manager_Article extends ZendAfi_Controller_Plugi
return;
}
$values = $this->_getCustomFieldModelValues($article);
$values->deleteValues();
$article->delete();
$this->withOtherPluginsDo(function($plugin) use($article)
{
......
......@@ -62,8 +62,11 @@ class ZendAfi_Controller_Plugin_Manager_UserGroup extends ZendAfi_Controller_Plu
null, true);
}
public function cataddAction() {
public function cataddAction() {
$form = new ZendAfi_Form_UserGroupCategorie();
$parent_id = $form->getElement('parent_id');
$parent_id->setMultiOptions([ 0 => $this->_('Aucune') ] + $parent_id->getMultiOptions());
$categorie = new Class_UserGroupCategorie();
if ($this->_isCategorieSaved($categorie,$form)) {
$this->_helper->notify($this->_view->_('La catégorie "%s" a été ajoutée', $categorie->getLibelle()));
......@@ -106,11 +109,16 @@ class ZendAfi_Controller_Plugin_Manager_UserGroup extends ZendAfi_Controller_Plu
$categorie
->updateAttributes($post);
return $form->isValid($categorie) ? $categorie->save() : false;
}
if ($form->isValid($categorie)) {
$categorie->save();
return true;
}
$categorie->setParentId($categorie->isNew()
? 0
: $categorie->getRawDbAttributes()['parent_id']);
return false;
}
public function cateditAction() {
......@@ -130,8 +138,9 @@ class ZendAfi_Controller_Plugin_Manager_UserGroup extends ZendAfi_Controller_Plu
$form
->populate(['libelle'=>$categorie->getLibelle()])
->setDefault('parent_id',$categorie->getParentId());
->populate(['libelle' => $categorie->getLibelle()])
->updateParentId($categorie);
$this->_view->form= $form;
$this->_view->titre = $this->_view->_('Modifier une catégorie d\'utilisateurs');
......
......@@ -35,6 +35,9 @@ class ZendAfi_Form_Admin_UserGroup extends ZendAfi_Form {
->setLabel('Libellé');
$this
->addElement('select', 'id_cat',
['label' => $this->_('Catégorie'),
'multiOptions' => Class_UserGroupCategorie::getUserGroupCategoriesLibelles()])
->addElement('radio',
'group_type',
['label' => $this->_('Mode de sélection des utilisateurs'),
......@@ -49,7 +52,7 @@ class ZendAfi_Form_Admin_UserGroup extends ZendAfi_Form {
->addElement('comboLibraries', 'id_bib',
['label' => $this->_('Bibliothèque')])
->addDisplayGroup(['libelle', 'group_type'],
->addDisplayGroup(['libelle', 'id_cat', 'group_type'],
'usergroup',
['legend' => $this->_('Groupe')])
......
......@@ -16,30 +16,39 @@
*
* You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
* along with BOKEH; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class ZendAfi_Form_UserGroupCategorie extends ZendAfi_Form {
public function init() {
parent::init();
$libelles = Class_UserGroupCategorie::getUserGroupCategoriesLibelles();
$this->addElement('text', 'libelle', ['label' => $this->_('Libellé de la catégorie'),
'required' => true,
'allowEmpty' => false])
$this
->addElement('text', 'libelle', ['label' => $this->_('Libellé de la catégorie'),
'required' => true,
'allowEmpty' => false])
->addElement('select', 'parent_id', ['label' => $this->_('Liste des catégories'),
'multiOptions' => $libelles])
->addDisplayGroup(['parent_id','libelle'],
'catégorie',
['legend' => $this->_('Catégorie')]);
}
public function updateParentId($categorie) {
$cat_path = $categorie->getPath();
$options = array_filter($this->getElement('parent_id')->getMultiOptions(),
function($id) use ($cat_path)
{
return 0 !== strpos(Class_UserGroupCategorie::find($id)->getPath(),
$cat_path);
},
ARRAY_FILTER_USE_KEY);
$this->getElement('parent_id')
->setMultiOptions([ 0 => $this->_('Aucune') ] + $options);
$this->setDefault('parent_id', $categorie->getParentId());
}
}
?>
\ No newline at end of file
......@@ -71,11 +71,10 @@ class ZendAfi_View_Helper_LibraryOpenings extends ZendAfi_View_Helper_BaseHelper
protected function _renderPeriods($periodical) {
if (!$periodical)
return '';
return ($periodical)
? $this->_renderPeriod(current($periodical))
return $periodical
? implode('',
array_map([$this, '_renderPeriod'],
$periodical))
: '';
}
......
......@@ -82,7 +82,7 @@ class Bokeh_Engine {
function setupConstants() {
defineConstant('BOKEH_MAJOR_VERSION','7.11');
defineConstant('BOKEH_RELEASE_NUMBER', BOKEH_MAJOR_VERSION . '.15');
defineConstant('BOKEH_RELEASE_NUMBER', BOKEH_MAJOR_VERSION . '.16');
defineConstant('BOKEH_REMOTE_FILES', 'http://git.afi-sa.fr/afi/opacce/');
......
storm @ 1a97b3cd
Subproject commit 5d921fbadd09b2c3e52a2d4c835580efcfb2adff
Subproject commit 1a97b3cdbe964e5d7379e0b9e43c8f79f44c0831
......@@ -285,6 +285,8 @@ if (initializeNoticeMurAnimation == undefined) {
function showCSSEditor() {
amberReadyDo(function() {
smalltalk.AFICssEditor._open();
$('#amber').on('hide',
deactivate_css_editor);
});
}
......@@ -292,6 +294,8 @@ function showCSSEditor() {
function showAmberIDE() {
amberReadyDo(function() {
smalltalk.Browser._open();
$('#amber').on('hide',
deactivate_amber_ide);
});
}
......
......@@ -22,7 +22,7 @@
$.fn.on_form_change_do = function(options) {
var button = $(this);
var callback = options.callback;
var do_callback = function () { eval(options.callback); };
var form = button.parent().nextAll('form');
......@@ -37,19 +37,14 @@
form.on('change paste input',
'input:not([id^="multiple-selection"]), select, textarea',
function()
{
eval(callback);
});
do_callback);
if( 'undefined' == typeof(CKEDITOR))
return;
for(var instance in CKEDITOR.instances)
CKEDITOR.instances[instance].on('change',
function()
{
eval(callback);
});
for(var instance in CKEDITOR.instances) {
CKEDITOR.instances[instance].on('change', do_callback);
CKEDITOR.instances[instance].on('dialogHide', do_callback);
}
}
} (jQuery));
......@@ -56,7 +56,7 @@ abstract class CmsControllerCustomFieldsTestCase extends AbstractControllerTestC
$this->_custom_field = $this->fixture('Class_CustomField',
['id' => 5,
['id' => 5,
'priority' => 3,
'meta' => $meta,
'model' => 'Article']);
......@@ -71,6 +71,7 @@ abstract class CmsControllerCustomFieldsTestCase extends AbstractControllerTestC
class CmsControllerCustomFieldsEditActionTest extends CmsControllerCustomFieldsTestCase {
public function setUp() {
parent::setUp();
......@@ -92,6 +93,37 @@ class CmsControllerCustomFieldsEditActionTest extends CmsControllerCustomFieldsT
class CmsControllerCustomFieldsWithNewbiesSetActionTest extends CmsControllerCustomFieldsTestCase {
public function setUp() {
parent::setUp();
$this->fixture('Class_CustomField_Value',
['id' => 10,
'model_id' => 1,
'custom_field_id' => 5,
'value' => 'newbies']);
}
/** @test */
public function editActionShouldHaveNewbiesOptionSelected() {
$this->dispatch('admin/cms/edit/id/1' ,true);
$this->assertXPathContentContains('//select[@name="field_5"]//option[@selected="selected"]',
'newbies');
}
/** @test */
public function deleteActionShouldDeleteAssociatedCustomFieldValue() {
$this->dispatch('admin/cms/force-delete/id/1' ,true);
Class_CustomField_Value::clearCache();
$this->assertNull(Class_CustomField_Value::find(10));
}
}
class CmsControllerCustomFieldsAndIndexationPostEditActionTest
extends CmsControllerCustomFieldsTestCase {
protected
......
......@@ -366,6 +366,7 @@ class CmsControllerListModeAdminBibSearchTest extends CmsControllerListModeTestC
'order' => 'titre',
'limitPage' => [0, 25]])
->answers([Class_Article::find(1)])
->whenCalled('countBy')
->with(['where' => '(titre like \'%news%\')',
'id_cat' => [1,23,34],
......@@ -377,19 +378,19 @@ class CmsControllerListModeAdminBibSearchTest extends CmsControllerListModeTestC
$this->dispatch('/admin/cms/index/title_search/news', true);
}
/** @test */
public function upButtonInTitleShouldBeUrlWithOrderTitle() {
$this->assertXPath('//th//a[contains(@href,"/admin/cms/index/title_search/news/order/titre")]',$this->_response->getBody());
}
/** @test */
/** @test */
public function downButtonInTitleShouldBeUrlWithOrderTitleDesc() {
$this->assertXPath('//th//a[contains(@href,"/admin/cms/index/title_search/news/order/titre+desc")]',$this->_response->getBody());
}
/** @test */
public function newsFromPortailShouldNotBePresent() {
$this->assertNotXPathContentContains('//td', 'News from portail');
......@@ -509,3 +510,19 @@ class CmsControllerListModeSearchPostFormTest extends CmsControllerListModeTestC
$this->assertRedirectTo('/admin/cms/index/title_search/abc/order/date_maj/status_search/1');
}
}
class CmsControllerListModeBackToIndexFromArticlesConcertTest extends CmsControllerListModeTestCase {
public function setUp() {
parent::setUp();
$this->dispatch('/admin/cms/index/id/4', true);
}
/** @test */
public function breadCrumbShouldDisplayCategoryEvents() {
$this->assertXPathContentContains('//div[@class="breadcrumb"]//a[contains(@href, "id_cat/34")]', 'Evènements');
}
}
......@@ -2819,11 +2819,15 @@ class CmsControllerCategorieNotFoundTest extends CmsControllerTestCase {
class CmsControllerNewsAddToCatALaUneInNewsModuleActionTest extends CmsControllerWithPermissionTestCase {
protected $_new_article;
public function setup() {
parent::setup();
$cfg_accueil_jeunesse = ['modules' => ['10' => ['division' => '2',
'type_module' => 'NEWS']],
'type_module' => 'NEWS',
'id_items' => '99-12', //see http://forge.afi-sa.fr/issues/67041
'preferences' => ['id_items' => '99-12']]],
'options' => []];
......@@ -2847,16 +2851,42 @@ class CmsControllerNewsAddToCatALaUneInNewsModuleActionTest extends CmsControlle
'id_cat' => 34,
'contenu' => 'Ici: <img src="../../images/bonlieu.jpg" />',
'description' => 'Affiche: <img src="http://localhost' . BASE_URL . '/images/concert.jpg" />']);
$this->_new_article = Class_Article::findFirstBy(['order' => 'id desc']);
}
/** @test */
public function newArticleShouldHaveTitleErikTruffaz() {
$this->assertEquals('Erik Truffaz - Ladyland quartet en concert',
$this->_new_article->getTitre());
}
/** @test **/
public function boiteNewsShouldDisplayArticleConcert() {
$this->assertEquals(Class_Article::findFirstBy(['order' => 'id desc'])->getId(),
public function boiteNewsShouldAddArticleConcertToCurrentSelection() {
$this->assertEquals($this->_new_article->getId() . '-99-12',
Class_Profil::getCurrentProfil()->getModuleAccueilPreferences(10, 'NEWS')['id_items']);
}
/**
* @test
* @see http://forge.afi-sa.fr/issues/67041
*/
public function newsWidgetFuzzyConfigurationShouldHaveIdItemsUpdated() {
$widget = new Class_Systeme_Widget_Widget();
$widget
->setId(10)
->setProfileId(Class_Profil::getCurrentProfil()->getId())
->load();
$this->assertEquals($this->_new_article->getId() . '-99-12',
$widget->getLocalSettings()['id_items']);
}
/** @test **/
public function profilShouldHaveBeenSaved() {
$this->assertTrue(Class_Profil::methodHasBeenCalled('save'));
......
......@@ -470,7 +470,8 @@ class Admin_UserGroupCategorieControllerCataddPostInvalidDataTest extends Admin_
public function setUp() {
parent::setUp();
$this->postDispatch('admin/usergroup/catadd',
['libelle' => '']);
['libelle' => '',
'parent_id' => 0]);
}
......@@ -517,6 +518,13 @@ class Admin_UserGroupControllerEditGroupStagiairesTest extends Admin_UserGroupCo
/** @test */
public function selectIdCatShouldHaveOptionFiveSelected() {
$this->assertXPathContentContains('//select[@name="id_cat"]/option[@selected="selected"][@value="5"]',
'Etablissement &gt; Association');
}
/** @test */
public function rightSuivreActivityShouldBeChecked() {
$this->assertXPath('//input[@name="rights_permissions[]"][@value="right-0"][@checked]', $this->response->getBody());
}
......@@ -1118,7 +1126,13 @@ class Admin_UserGroupControllerAddCategoryTest extends Admin_UserGroupController
/** @test **/
public function categorySelectShoudContainsAssociation() {
$this->assertXPathContentContains('//option', 'Association', $this->_response->getBody());
$this->assertXPathContentContains('//select[@name="parent_id"]/option', 'Association', $this->_response->getBody());
}
/** @test **/
public function categorySelectShoudContainsNone() {
$this->assertXPathContentContains('//select[@name="parent_id"]/option[@value="0"]', 'Aucune');
}
......@@ -1174,15 +1188,16 @@ class Admin_UserGroupControllerDeleteCategorieTest extends Admin_UserGroupContro
public function setup() {
parent::setup();
$etablissement = $this->fixture('class_UserGroupCategorie',
['id' => 5,
'libelle'=>'Etablissement',
'parent_id' => 0]);
$association = $this->fixture('Class_UserGroupCategorie',
['id' => 2,
'libelle' => 'Association',
'parent_id' => 5]);