Skip to content
Snippets Groups Projects
Commit 22e0126a authored by efalcy's avatar efalcy
Browse files

#9929 : tests ajout d'un trait pour le groupe referent

git-svn-id: http://afi-forge.afi-sa.fr/svn/opacce/trunk@2712 e3cc70dd-a52f-4065-8a26-0e09943c8c5c
parent d0de039a
No related merge requests found
<?php
/**
* Copyright (c) 2012, Agence Française Informatique (AFI). All rights reserved.
*
* AFI-OPAC 2.0 is free software; you can redistribute it and/or modify
* it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by
* the Free Software Foundation.
*
* There are special exceptions to the terms and conditions of the AGPL as it
* is applied to this software (see README file).
*
* AFI-OPAC 2.0 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
* along with AFI-OPAC 2.0; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
trait Trait_UserGroupFixtures {
protected $_referent;
protected $_referent_membership;
public function addUserToRightsReferent($user) {
$this->_referent = Class_UserGroup::newInstanceWithId(28)
->setLibelle('Referent')
->setRights([
Class_UserGroup::RIGHT_USER_DOMAINES_SUPPRESSION_LIMIT,
Class_UserGroup::RIGHT_USER_FILE_ACCESS,
Class_UserGroup::RIGHT_USER_SITOTHEQUE,
Class_UserGroup::RIGHT_USER_MODO,
Class_UserGroup::RIGHT_USER_INSCRIPTIONS,
Class_UserGroup::RIGHT_USER_BIB_NUM,
Class_UserGroup::RIGHT_USER_OPDS_READ,
Class_UserGroup::RIGHT_USER_NOTICES_LIEES,
Class_UserGroup::RIGHT_USER_SIGB_USER_READ
]);
Storm_Test_ObjectWrapper::onLoaderOfModel('Class_UserGroupMembership')
->whenCalled('findAllBy')
->with(array('role' => 'user_group',
'model' => $this->_referent))
->answers([
$this->_referent_membership = Class_UserGroupMembership::getLoader()
->newInstanceWithId(223)
->setUserId($user->getId())
->setUserGroupId(2222)]);
}
}
?>
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