Commit af13f8db authored by Patrick Barroca's avatar Patrick Barroca 😠

hotline #61301 : fix LeKiosk is a plugin in master

parent d7198b09
......@@ -121,7 +121,9 @@ class LeKioskLinkModeSSOTest extends LeKioskLinkModeLinkTestCase {
class ModulesControllerLeKioskUserWithGroupWithRightCasTest extends AbstractControllerTestCase {
class LeKioskModulesControllerUserWithGroupWithRightTest
extends AbstractControllerTestCase {
protected $_storm_default_to_volatile = true;
public function setUp() {
......@@ -166,6 +168,27 @@ class ModulesControllerLeKioskUserWithGroupWithRightCasTest extends AbstractCont
class LeKioskModulesControllerUserWithGroupWithRightInPhoneTest
extends LeKioskModulesControllerUserWithGroupWithRightTest {
public function setUp() {
parent::setUp();
$_SERVER['HTTP_USER_AGENT'] = 'iPhone';
Class_Profil::getCurrentProfil()
->beTelephone()
->assertSave();
}
public function tearDown() {
unset($_SERVER['HTTP_USER_AGENT']);
parent::tearDown();
}
}
class LeKioskModulesControllerTest extends AbstractControllerTestCase {
protected
......
<?php
/**
* Copyright (c) 2012, Agence Française Informatique (AFI). All rights reserved.
*
* BOKEH 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).
*
* BOKEH 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 BOKEH; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
require_once 'TelephoneAbstractControllerTestCase.php';
class ModulesControllerTest extends TelephoneAbstractControllerTestCase {
protected $_storm_default_to_volatile = true;
public function setUp() {
parent::setUp();
$cfg_accueil =
['modules' => ['1' => ['division' => '1',
'type_module' => 'RECH_SIMPLE',
'preferences' => []],
'2' => ['division' => '1',
'type_module' => 'NEWS',
'preferences' => ['titre' => 'Concerts',
'rss_avis' => 0]],
'3' => ['division' => '1',
'type_module' => 'LOGIN',
'preferences' => ['titre' => 'Se connecter',
'identifiant' => 'identifiant',
'identifiant_exemple' => 'numero carte',
'mot_de_passe' => 'mot de passe',
'mot_de_passe_exemple' => 'zork',
'lien_connexion' => 'go']],
'4' => ['division' => '1',
'type_module' => 'BIB_NUMERIQUE',
'preferences' => ['titre' => 'Mes albums']],
'5' => ['division' => '1',
'type_module' => 'CALENDAR',
'preferences' => ['titre' => 'Agenda']],
'6' => ['division' => '1',
'type_module' => 'CRITIQUES',
'preferences' => ['titre' => 'Critiques']],
'7' => ['division' => '1',
'type_module' => 'LIBRARY',
'preferences' => ['titre' => 'Libraries']]
]];
$this->profil_adulte = $this->fixture('Class_Profil', ['id' => 2])
->setTitreSite('Smartphone')
->setLibelle(null)
->setCfgAccueil($cfg_accueil)
->setSkin('vide')
->setHeaderCss('mon_style.css')
->setHauteurBanniere(150)
->setBrowser('telephone')
->beCurrentProfil();
$this->fixture('Class_Profil', ['id' => 34,
'parent_profil' => $this->profil_adulte]);
Class_Profil_Skin::setFileSystem((new Storm_FileSystem_Volatile())
->mkdir('/public/opac/skins/vide/css/')
->touch('/public/opac/skins/vide/css/mobile.css'));
Class_Profil::setFileWriter(Storm_Test_ObjectWrapper::mock()->whenCalled('fileExists')->answers(true));
Class_AdminVar::set('LEKIOSK_SSO_MODE', '');
RessourcesNumeriquesFixtures::activateLeKiosk();
$group = $this->fixture('Class_UserGroup', ['id' => 1])
->addRight(Class_UserGroup::RIGHT_ACCES_LEKIOSK);
Class_Users::getIdentity()->setUserGroups([$group]);
$this->dispatch('/opac/modules/lekiosk');
}
public function tearDown() {
Class_Profil_Skin::setFileSystem(null);
parent::tearDown();
}
/** @test */
public function shouldHaveAccessToLekiosk() {
$this->assertContains('https://pros.lekiosk.com/login/accesshash',
$this->_response->getBody());
}
}
Markdown is supported
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