Skip to content
Snippets Groups Projects

Hotline master

Merged Ghislain Loas requested to merge hotline-master into master
Compare and
+ 60
59
Preferences
Compare changes
@@ -88,20 +88,20 @@ abstract class AdminCatalogueControllerTestCase extends AbstractControllerTestCa
'pseudo' => 'referent']);
$histoire = Class_Catalogue::newInstanceWithId(100,
[ 'libelle' => 'Histoire',
'sous_domaines' => [
Class_Catalogue::newInstanceWithId(200, [ 'libelle' => 'Politique',
'parent_id' => 100,
'dewey' =>78308,
'paniers' => []
]),
'sous_domaines' => [
Class_Catalogue::newInstanceWithId(200, [ 'libelle' => 'Politique',
'parent_id' => 100,
'dewey' =>78308,
'paniers' => []
]),
Class_Catalogue::newInstanceWithId(300, [ 'libelle'=>'Moyen-age',
'user' => $this->user_referent,
'parent_id' => 100,
'paniers' => [] ])],
Class_Catalogue::newInstanceWithId(300, [ 'libelle'=>'Moyen-age',
'user' => $this->user_referent,
'parent_id' => 100,
'paniers' => [] ])],
'panier_notices' => [$panier_jeunesse_dupont, $panier_adulte_duchamp]
]);
'panier_notices' => [$panier_jeunesse_dupont, $panier_adulte_duchamp]
]);
@@ -253,9 +253,9 @@ class CatalogueControllerWithAdminBibAndRightTotalAccessTest extends AdminCatalo
public function setUp() {
parent::setUp();
Class_Users::getIdentity()->setUserGroups([
Class_UserGroup::newInstanceWithId(667)
->addRightDomainesTotalAccess()
]);
Class_UserGroup::newInstanceWithId(667)
->addRightDomainesTotalAccess()
]);
}
@@ -413,7 +413,7 @@ class CatalogueControllerWithAModoBibWithoutRightAccesDomainesIndexTest extends
Class_UserGroup::beVolatile();
ZendAfi_Auth::getInstance()->logUser(
Class_Users::newInstanceWithId(3)->beModoBib());
Class_Users::newInstanceWithId(3)->beModoBib());
$this->dispatch('admin/catalogue/index', true);
}
@@ -499,9 +499,9 @@ class CatalogueControllerWithAModoBibWithRightAccesDomainesIndexTest extends Adm
Class_UserGroup::beVolatile();
ZendAfi_Auth::getInstance()->logUser(
Class_Users::newInstanceWithId(3)
->beModoBib()
->setUserGroups([Class_UserGroup::newInstanceWithId(4)->addRightAccessDomaines()]));
Class_Users::newInstanceWithId(3)
->beModoBib()
->setUserGroups([Class_UserGroup::newInstanceWithId(4)->addRightAccessDomaines()]));
$this->dispatch('admin/catalogue/index');
}
@@ -547,6 +547,7 @@ class CatalogueControllerWithAModoBibWithRightAccesDomainesIndexTest extends Adm
class CatalogueControllerActionTesterNoIndexationTest extends AbstractControllerTestCase {
protected $_storm_default_to_volatile = true;
protected function _loginHook($account) {
$account->ROLE_LEVEL = ZendAfi_Acl_AdminControllerRoles::SUPER_ADMIN;
}
@@ -1061,9 +1062,9 @@ class CatalogueControllerAddCataloguePostTest extends AdminCatalogueControllerTe
Class_Catalogue::whenCalled('save')
->willDo(
function($model) {
return $model->setId(987);
});
function($model) {
return $model->setId(987);
});
$this->postDispatch('/admin/catalogue/add', ['libelle' => 'Geeks',
'pcdm4' => '5',
@@ -1124,18 +1125,18 @@ class CatalogueControllerAddCatalogueToAdultesPostTest extends AdminCatalogueCon
Class_Profil::getCurrentProfil()
->setCfgAccueil([
'modules' => [
'10' => ['division' => '2',
'type_module' => 'KIOSQUE']],
'modules' => [
'10' => ['division' => '2',
'type_module' => 'KIOSQUE']],
'options' => []]);
'options' => []]);
Class_Catalogue::whenCalled('save')
->willDo(
function($model) {
return $model->setId(78);
});
function($model) {
return $model->setId(78);
});
$this->postDispatch('/admin/catalogue/add/id_module/10',
@@ -1158,9 +1159,9 @@ class CatalogueControllerAddCatalogueToAdultesPostTest extends AdminCatalogueCon
/** @test **/
public function boiteKiosqueShouldBeUpdatedToNewCatalogue78() {
$this->assertEquals(
78,
Class_Profil::getCurrentProfil()
->getModuleAccueilPreferences(10, 'KIOSQUE')['id_catalogue']);
78,
Class_Profil::getCurrentProfil()
->getModuleAccueilPreferences(10, 'KIOSQUE')['id_catalogue']);
}
}
@@ -1427,31 +1428,31 @@ class CatalogueControllerDomaintePaniersJsonActionTest extends AbstractControlle
$expectedJSON =
[
['id' => 'panier_for_user',
'label' => 'Mes paniers',
'categories' => [],
'items' => [],
'options' => ['multipleSelection' => false]],
['id' => 'domaines_paniers',
'label' => 'Domaines',
'categories' => [],
'items' => [],
'options' => ['multipleSelection' => false,
'ico' => BASE_URL.'/public/admin/images/picto/domaines_16.png']],
['id' => 'paniers_by_users',
'label' => 'Paniers sans domaine, rattachés à leur créateur',
'categories' => [22 => ['id' => 'cart-owner-id-22',
'label' => 'Marie-Laure',
'categories' => [],
'items' => [['id' => 22,
'label' => 'Top 5 CDs',
'options' => ['ico' => URL_ADMIN_IMG.'picto/paniers_16.png']]],
'options' => ['ico' => URL_ADMIN_IMG.'picto/abonnes.gif',
'removeCheckbox' => true]]],
'items' => [],
'options' => ['multipleSelection' => false]]];
['id' => 'panier_for_user',
'label' => 'Mes paniers',
'categories' => [],
'items' => [],
'options' => ['multipleSelection' => false]],
['id' => 'domaines_paniers',
'label' => 'Domaines',
'categories' => [],
'items' => [],
'options' => ['multipleSelection' => false,
'ico' => BASE_URL.'/public/admin/images/picto/domaines_16.png']],
['id' => 'paniers_by_users',
'label' => 'Paniers sans domaine, rattachés à leur créateur',
'categories' => [22 => ['id' => 'cart-owner-id-22',
'label' => 'Marie-Laure',
'categories' => [],
'items' => [['id' => 22,
'label' => 'Top 5 CDs',
'options' => ['ico' => URL_ADMIN_IMG.'picto/paniers_16.png']]],
'options' => ['ico' => URL_ADMIN_IMG.'picto/abonnes.gif',
'removeCheckbox' => true]]],
'items' => [],
'options' => ['multipleSelection' => false]]];
$this->assertJsonStringEqualsJsonString(json_encode($expectedJSON),
$this->_response->getBody(), $this->_response->getBody());
@@ -1611,7 +1612,7 @@ class CatalogueControllerGetBrowsableDomainsJsonTest extends AbstractControllerT
$this->fixture('Class_Catalogue',
['id' => 6,
'libelle' => 'News',
'libelle' => 'News',
'indexer' => true]);
$this->fixture('Class_Catalogue',
@@ -1675,7 +1676,7 @@ class CatalogueControllerRenamingTest extends AbstractControllerTestCase {
parent::setUp();
$this->fixture('Class_Catalogue',
['id' => 6,
'libelle' => 'News']);
'libelle' => 'News']);
$this->postDispatch('/admin/catalogue/edit/id_catalogue/6', ['libelle' => 'Jeunes']);
}