Commit 6e55492e authored by Laurent's avatar Laurent

Merge branch 'hotline'

parents e91c4200 438a94ad
Pipeline #5870 passed with stage
in 30 minutes and 59 seconds
...@@ -3,7 +3,7 @@ RewriteEngine on ...@@ -3,7 +3,7 @@ RewriteEngine on
RewriteCond %{REQUEST_URI} !^/(google[a-z0-9]+\.html|.*/xhprof_html|ckeditor|exploit|\.well-known) RewriteCond %{REQUEST_URI} !^/(google[a-z0-9]+\.html|.*/xhprof_html|ckeditor|exploit|\.well-known)
RewriteCond %{REQUEST_FILENAME} !^.*/robots\.txt$ [NC] RewriteCond %{REQUEST_FILENAME} !^.*/robots\.txt$ [NC]
RewriteRule !(userfiles|public|tmp|temp|skins|library/templates|library/digital_resources/.*/js)/.*\.(js|ico|txt|gif|jpg|jpeg|png|css|xml|swf|mov|pdf|doc|docx|woff|woff2|eot|svg|ttf|xls|wsdl|mp3|m4v|ogg|ogv|epub|htm|html|xhtml|asmx|zip|sql|bro|flv|mp4|webm|tgz|json|geojson|xsl)$ index.php [NC,NE] RewriteRule !(userfiles|public|tmp|temp|skins|library/templates|library/digital_resources/.*/js)/.*\.(js|ico|txt|gif|jpg|jpeg|png|css|xml|swf|mov|pdf|doc|docx|woff|woff2|eot|svg|ttf|xls|xlsx|wsdl|mp3|m4v|ogg|ogv|epub|htm|html|xhtml|asmx|zip|sql|bro|flv|mp4|webm|tgz|json|geojson|xsl)$ index.php [NC,NE]
AddType application/x-javascript .js AddType application/x-javascript .js
AddType text/css .css AddType text/css .css
......
08/01/2019 - v7.12.52
- ticket #81938 : correction de la sauvegarde du paramétrage des boîtes qui pouvait échouer dans certaines conditions
- ticket #82346 : Configuration : autorisation de téléversement des fichiers .xslx dans la liste des fichiers autorisés
- ticket #83536 : Boite Avis : ajout du contexte de retour manquant dans les liens vers les notices
- ticket #83674 : SIGB Opsys : suppression de l'identification par le numéro de carte abonné lorsqu'il était différent de l'identifiant
- ticket #84068 : SIGB Orphee: correction du fonctionnement lorque le webservice n'utilise pas de mots de passe
20/12/2018 - v7.12.51 20/12/2018 - v7.12.51
- ticket #83526 : Cosmogramme : SIGB Nanook : Amélioriation de la mise à jour de l'étalon lors de la modification des libellés de sections, genres et emplacements - ticket #83526 : Cosmogramme : SIGB Nanook : Amélioriation de la mise à jour de l'étalon lors de la modification des libellés de sections, genres et emplacements
......
...@@ -301,6 +301,4 @@ class Admin_WidgetController extends ZendAfi_Controller_Action { ...@@ -301,6 +301,4 @@ class Admin_WidgetController extends ZendAfi_Controller_Action {
public function formProvider($widget) { public function formProvider($widget) {
return call_user_func_array([$widget->getForm(), 'newWith'], [$widget->forForm()]); return call_user_func_array([$widget->getForm(), 'newWith'], [$widget->forForm()]);
} }
} }
\ No newline at end of file
...@@ -102,7 +102,7 @@ class BlogController extends ZendAfi_Controller_Action { ...@@ -102,7 +102,7 @@ class BlogController extends ZendAfi_Controller_Action {
public function viewcritiquesAction() { public function viewcritiquesAction() {
$this->view->page = $this->_getParam('page', 1); $this->view->page = $this->_getParam('page', 1);
$id_module = (int)$this->_getParam('id_module'); $this->view->id_module = $id_module = (int)$this->_getParam('id_module');
$profil = Class_Profil::getCurrentProfil(); $profil = Class_Profil::getCurrentProfil();
$preferences = $profil->getModuleAccueilPreferences($id_module, 'CRITIQUES'); $preferences = $profil->getModuleAccueilPreferences($id_module, 'CRITIQUES');
......
<?php <?php
$this->openBoite($this->title); $this->openBoite($this->title);
if(is_array($this->liste_avis))
{ if (is_array($this->liste_avis)) {
$helper = $this->getHelper('Avis');
if ($this->id_module)
$helper->addUrlContext(['retour_avis' => $this->id_module]);
$html_avis = []; $html_avis = [];
foreach($this->liste_avis as $avis) foreach($this->liste_avis as $avis)
$html_avis []= $this->avis($avis); $html_avis []= $helper->avis($avis);
echo implode('<div class="separator"></div>', $html_avis); echo implode('<div class="separator"></div>', $html_avis);
} }
echo BR.'<div align="center" style="width:100%">'.$this->pager($this->total,$this->config['nb_display'],$this->page,$this->params_url ).'</div>'; echo BR . $this->tag('div',
$this->pager($this->total,
$this->config['nb_display'],
$this->page,
$this->params_url),
['align' => 'center',
'style' => 'width:100%s']);
$this->closeBoite(); $this->closeBoite();
?>
...@@ -42,7 +42,7 @@ class Class_Systeme_ModulesAccueil_ConteneurDeuxColonnes extends Class_Systeme_M ...@@ -42,7 +42,7 @@ class Class_Systeme_ModulesAccueil_ConteneurDeuxColonnes extends Class_Systeme_M
public function updateHook($datas) { public function updateHook($datas) {
foreach(['gauche', 'droite'] as $column) { foreach(['gauche', 'droite'] as $column) {
$key = 'col_' . $column .'_module_id'; $key = 'col_' . $column .'_module_id';
$datas [$key] = $datas['preferences'][$key] = static::createModuleForCol($column, $datas, $datas['id_module'], $datas['profile_id']); $datas [$key] = $datas['preferences'][$key] = static::createModuleForCol($column, $datas['preferences'], $datas['id_module'], $datas['profile_id']);
} }
return $datas; return $datas;
......
...@@ -145,9 +145,9 @@ class Class_Systeme_ModulesAccueil_Library extends Class_Systeme_ModulesAccueil_ ...@@ -145,9 +145,9 @@ class Class_Systeme_ModulesAccueil_Library extends Class_Systeme_ModulesAccueil_
public function updateHook($datas) { public function updateHook($datas) {
if(array_key_exists('default_filters', $datas) if (array_key_exists('default_filters', $datas['preferences'])
&& (!is_array($datas['default_filters']))) && (!is_array($datas['preferences']['default_filters'])))
$datas['default_filters'] = []; $datas['preferences']['default_filters'] = [];
return $datas; return $datas;
} }
......
...@@ -61,13 +61,13 @@ class Class_Systeme_ModulesAccueil_MenuVertical extends Class_Systeme_ModulesAcc ...@@ -61,13 +61,13 @@ class Class_Systeme_ModulesAccueil_MenuVertical extends Class_Systeme_ModulesAcc
public function updateHook($datas) { public function updateHook($datas) {
if(!isset($datas['menu'])) if(!isset($datas['preferences']['menu']))
return $datas; return $datas;
if(static::NEW_MENU != $datas['menu']) if(static::NEW_MENU != $datas['preferences']['menu'])
return $datas; return $datas;
$datas['menu'] = $this->_prefixMenu($this->addMenu()); $datas['preferences']['menu'] = $this->_prefixMenu($this->addMenu());
return $datas; return $datas;
} }
......
...@@ -52,11 +52,11 @@ class Class_Systeme_ModulesAccueil_Sitotheque extends Class_Systeme_ModulesAccue ...@@ -52,11 +52,11 @@ class Class_Systeme_ModulesAccueil_Sitotheque extends Class_Systeme_ModulesAccue
public function updateHook($datas) { public function updateHook($datas) {
if(static::DISPLAY_HIERARCHY != $datas['type_aff']) if(static::DISPLAY_HIERARCHY != $datas['preferences']['type_aff'])
return $datas; return $datas;
if ($categories = explode('-', $datas['id_categorie'])) if ($categories = explode('-', $datas['preferences']['id_categorie']))
$datas['preferences']['id_categorie'] = $datas['id_categorie'] = $categories[0]; $datas['preferences']['id_categorie'] = $categories[0];
return $datas; return $datas;
} }
......
...@@ -41,4 +41,13 @@ class Class_Systeme_ModulesAccueil_Tags extends Class_Systeme_ModulesAccueil_Nul ...@@ -41,4 +41,13 @@ class Class_Systeme_ModulesAccueil_Tags extends Class_Systeme_ModulesAccueil_Nul
'id_panier' => 0, 'id_panier' => 0,
'id_catalogue' => 0]; 'id_catalogue' => 0];
} }
public function updateHook($datas) {
if (isset($datas['preferences']['type_tags_codes'])) {
$datas['preferences']['type_tags'] = str_replace(';', '', $datas['preferences']['type_tags_codes']);
unset($datas['preferences']['type_tags_codes']);
}
return $datas;
}
} }
\ No newline at end of file
...@@ -89,10 +89,10 @@ abstract class Class_Systeme_Widget_Abstract extends Class_Entity { ...@@ -89,10 +89,10 @@ abstract class Class_Systeme_Widget_Abstract extends Class_Entity {
protected function _getValues($attributes) { protected function _getValues($attributes) {
return $this->_getWidgetResources() return $this->_getWidgetResources()
->getValues(array_merge(isset($attributes['preferences']) ->getValues(array_merge($attributes,
isset($attributes['preferences'])
? $attributes['preferences'] ? $attributes['preferences']
: [], : []));
$attributes));
} }
......
...@@ -36,16 +36,34 @@ class Class_Systeme_Widget_Widget extends Class_Systeme_Widget_Abstract { ...@@ -36,16 +36,34 @@ class Class_Systeme_Widget_Widget extends Class_Systeme_Widget_Abstract {
} }
protected function _cleanRootAndPreferences($datas) {
$root_properties = ['type_module' => '',
'division' => '',
'id_module' => '',
'preferences' => '',
'parent_id' => '',
'type_menu' => '',
'libelle' => '',
'picto' => '',
'sous_menus' => []];
$cleaned_datas = array_intersect_key($datas, $root_properties);
$cleaned_datas['preferences'] = array_diff_key($datas,
$root_properties);
return $cleaned_datas;
}
protected function _update() { protected function _update() {
$datas = array_merge($this->getLocalSettings(), $cleaned_datas = $this->_cleanRootAndPreferences(
$this->getNewDatas()); array_merge($this->getLocalSettings(),
$this->getNewDatas()));
if(isset($datas['preferences'])) $cleaned_datas['profile_id'] = $this->getProfileId();
unset($datas['preferences']); $datas = $this->_getWidgetResources()->updateHook($cleaned_datas);
$datas['preferences'] = $datas;
$datas['profile_id'] = $this->getProfileId();
$datas = $this->_getWidgetResources()->updateHook($datas);
$sub_menus = null; $sub_menus = null;
if(isset($datas['children'])) if(isset($datas['children']))
$sub_menus = $this->_convertChildren($datas['children']); $sub_menus = $this->_convertChildren($datas['children']);
......
...@@ -188,7 +188,6 @@ abstract class Class_WebService_SIGB_AbstractRESTService extends Class_WebServic ...@@ -188,7 +188,6 @@ abstract class Class_WebService_SIGB_AbstractRESTService extends Class_WebServic
public function ilsdiGetPatronInfo($params, $reader, $error_tag='error') { public function ilsdiGetPatronInfo($params, $reader, $error_tag='error') {
$emprunteur = Class_WebService_SIGB_Emprunteur::newInstance()->setService($this); $emprunteur = Class_WebService_SIGB_Emprunteur::newInstance()->setService($this);
$params = array_merge(array('service' => 'GetPatronInfo'), $params); $params = array_merge(array('service' => 'GetPatronInfo'), $params);
$xml = $this->httpGet($params); $xml = $this->httpGet($params);
if (0 === strpos($xml, '<html>')) if (0 === strpos($xml, '<html>'))
......
...@@ -231,9 +231,8 @@ class Class_WebService_SIGB_Opsys_Service extends Class_WebService_SIGB_Abstract ...@@ -231,9 +231,8 @@ class Class_WebService_SIGB_Opsys_Service extends Class_WebService_SIGB_Abstract
* @return Class_WebService_SIGB_Emprunteur * @return Class_WebService_SIGB_Emprunteur
*/ */
public function authentifierEmprunteur($user) { public function authentifierEmprunteur($user) {
$auth = new EmprAuthentifier($this->guid, $auth = new EmprAuthentifier($this->guid, $user->getLogin(), $user->getPassword());
$user->hasIdabon() ? $user->getIdabon() : $user->getLogin(),
$user->getPassword());
try { try {
$auth_result = $this->search_client->EmprAuthentifier($auth); $auth_result = $this->search_client->EmprAuthentifier($auth);
} catch (Exception $e) { } catch (Exception $e) {
...@@ -254,7 +253,6 @@ class Class_WebService_SIGB_Opsys_Service extends Class_WebService_SIGB_Abstract ...@@ -254,7 +253,6 @@ class Class_WebService_SIGB_Opsys_Service extends Class_WebService_SIGB_Abstract
$emprunteur->setEndDate($date_fin_abonnement); $emprunteur->setEndDate($date_fin_abonnement);
} }
if ($date_naissance = $entite_result->findAttribute('DateNaissance')) { if ($date_naissance = $entite_result->findAttribute('DateNaissance')) {
$date_naissance = implode('-', array_reverse(explode('/', $date_naissance))); $date_naissance = implode('-', array_reverse(explode('/', $date_naissance)));
$emprunteur->setDateNaissance($date_naissance); $emprunteur->setDateNaissance($date_naissance);
......
...@@ -163,7 +163,7 @@ class Class_WebService_SIGB_Orphee_Service extends Class_WebService_SIGB_Abstrac ...@@ -163,7 +163,7 @@ class Class_WebService_SIGB_Orphee_Service extends Class_WebService_SIGB_Abstrac
protected function hasGetAdh() { protected function hasGetAdh() {
return $this->_search_client->hasFunction('GetAdh'); return $this->_search_client && $this->_search_client->hasFunction('GetAdh');
} }
......
...@@ -55,14 +55,9 @@ class ZendAfi_Auth extends Zend_Auth { ...@@ -55,14 +55,9 @@ class ZendAfi_Auth extends Zend_Auth {
public function newAuthDb() { public function newAuthDb() {
if ($this->_auth_db_adapter) return $this->_auth_db_adapter
return $this->_auth_db_adapter; ? $this->_auth_db_adapter
: $this->_auth_db_adapter = new ZendAfi_Auth_Adapter_DbTable();
$authAdapter = new ZendAfi_Auth_Adapter_DbTable(Zend_Db_Table::getDefaultAdapter());
$authAdapter->setTableName('bib_admin_users');
$authAdapter->setIdentityColumn('LOGIN');
$authAdapter->setCredentialColumn('PASSWORD');
return $this->_auth_db_adapter = $authAdapter;
} }
......
<?php
/**
* Copyright (c) 2012-2018, 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
*/
abstract class ZendAfi_Auth_Adapter_Abstract implements Zend_Auth_Adapter_Interface {
protected
$_identity,
$_credential,
$_authenticated_user;
public function shouldBreakChain() {
return false;
}
/**
* @param string $identity
* @return Zend_Auth_Adapter_Abstract
*/
public function setIdentity($identity) {
$this->_identity = $identity;
return $this;
}
/**
* @param string $credential
* @return Zend_Auth_Adapter_Abstract
*/
public function setCredential($credential) {
$this->_credential = $credential;
return $this;
}
/**
* @return Std_Class
*/
public function getResultObject() {
return $this->_authenticated_user->toStdClass();
}
}
...@@ -19,34 +19,10 @@ ...@@ -19,34 +19,10 @@
* 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_Auth_Adapter_CommSigb implements Zend_Auth_Adapter_Interface { class ZendAfi_Auth_Adapter_CommSigb extends ZendAfi_Auth_Adapter_Abstract {
protected protected
$_identity = null,
$_credential = null,
$_authenticated_user = null,
$_called_services = []; $_called_services = [];
/**
* @param string $identity
* @return Zend_Auth_Adapter_CommSigb
*/
public function setIdentity($identity) {
$this->_identity = $identity;
return $this;
}
/**
* @param string $credential
* @return Zend_Auth_Adapter_CommSigb
*/
public function setCredential($credential) {
$this->_credential = $credential;
return $this;
}
/** /**
* @return Zend_Auth_Result * @return Zend_Auth_Result
*/ */
...@@ -145,6 +121,9 @@ class ZendAfi_Auth_Adapter_CommSigb implements Zend_Auth_Adapter_Interface { ...@@ -145,6 +121,9 @@ class ZendAfi_Auth_Adapter_CommSigb implements Zend_Auth_Adapter_Interface {
protected function _getUserFromSigbWithLibrary($user, $library) { protected function _getUserFromSigbWithLibrary($user, $library) {
$this->_called_services[] = $service = $library->getSIGBComm(); $this->_called_services[] = $service = $library->getSIGBComm();
if (!$service->providesAuthentication())
return;
if (!$loaner = $service->getEmprunteur($user)) if (!$loaner = $service->getEmprunteur($user))
return; return;
...@@ -206,12 +185,4 @@ class ZendAfi_Auth_Adapter_CommSigb implements Zend_Auth_Adapter_Interface { ...@@ -206,12 +185,4 @@ class ZendAfi_Auth_Adapter_CommSigb implements Zend_Auth_Adapter_Interface {
$this->_authenticated_user = $user; $this->_authenticated_user = $user;
return $result; return $result;
} }
/**
* @return Std_Class
*/
public function getResultObject() {
return $this->_authenticated_user->toStdClass();
}
} }
...@@ -20,43 +20,24 @@ ...@@ -20,43 +20,24 @@
*/ */
class ZendAfi_Auth_Adapter_DbTable extends Zend_Auth_Adapter_DbTable { class ZendAfi_Auth_Adapter_DbTable extends ZendAfi_Auth_Adapter_Abstract {
public function shouldBreakChain() {
return false;
}
/** /** @return Zend_Auth_Result */
* _authenticateCreateSelect() - This method creates a Zend_Db_Select object that public function authenticate() {
* is completely configured to be queried against the database. $type = ($this->_authenticated_user = Class_Users::findFirstBy(['login' => $this->_identity,
* 'password' => $this->_credential,
* @return Zend_Db_Select 'password not' => '']))
*/ ? Zend_Auth_Result::SUCCESS
protected function _authenticateCreateSelect() { : Zend_Auth_Result::FAILURE_IDENTITY_NOT_FOUND;
if (empty($this->_credentialTreatment)
|| (strpos($this->_credentialTreatment, "?") === false))
$this->_credentialTreatment = '?';
$credentialExpression = new Zend_Db_Expr( return new Zend_Auth_Result($type, $this->_identity);
'(CASE WHEN ' .
$this->_zendDb->quoteInto(
$this->_zendDb->quoteIdentifier($this->_credentialColumn, true)
. ' = ' . $this->_credentialTreatment, $this->_credential
)
. ' THEN 1 ELSE 0 END) AS '
. $this->_zendDb->quoteIdentifier('zend_auth_credential_match')
);
return $this->_zendDb
->select()
->from($this->_tableName, array('*', $credentialExpression))
->where($this->_zendDb->quoteIdentifier($this->_identityColumn, true) . ' = ?', $this->_identity)
->where($this->_zendDb->quoteIdentifier($this->_credentialColumn, true) . ' = ?', $this->_credential)
->where($this->_zendDb->quoteIdentifier($this->_credentialColumn, true) . ' <> ?', '');
} }
public function getResultObject() { public function getResultObject() {
return $this->getResultRowObject(null,'password'); $object = parent::getResultObject();
unset($object->password);
return $object;
} }
} }
...@@ -81,7 +81,7 @@ class Bokeh_Engine { ...@@ -81,7 +81,7 @@ class Bokeh_Engine {
function setupConstants() { function setupConstants() {
defineConstant('BOKEH_MAJOR_VERSION','7.12'); defineConstant('BOKEH_MAJOR_VERSION','7.12');
defineConstant('BOKEH_RELEASE_NUMBER', BOKEH_MAJOR_VERSION . '.51'); defineConstant('BOKEH_RELEASE_NUMBER', BOKEH_MAJOR_VERSION . '.52');
defineConstant('BOKEH_REMOTE_FILES', 'http://git.afi-sa.fr/afi/opacce/'); defineConstant('BOKEH_REMOTE_FILES', 'http://git.afi-sa.fr/afi/opacce/');
......
...@@ -1061,7 +1061,7 @@ class ModoControllerDeleteExpiredRegistrationsTest extends Admin_AbstractControl ...@@ -1061,7 +1061,7 @@ class ModoControllerDeleteExpiredRegistrationsTest extends Admin_AbstractControl
['id' => 1, ['id' => 1,
'login' => 'pwd', 'login' => 'pwd',
'password' => 'pwd', 'password' => 'pwd',
'date' => '2018-16-01', 'date' => '2048-12-01',
'mail' => 'pwd@afi-sa.fr']); 'mail' => 'pwd@afi-sa.fr']);
$this->fixture('Class_UsersNonValid', $this->fixture('Class_UsersNonValid',
......
...@@ -233,13 +233,13 @@ class WidgetControllerKioquePostTest extends WidgetControllerPostDispatchWidgetC ...@@ -233,13 +233,13 @@ class WidgetControllerKioquePostTest extends WidgetControllerPostDispatchWidgetC
/** @test */ /** @test */
public function titleShouldBeTitreDuKiosque() { public function titleShouldBeTitreDuKiosque() {
$this->assertEquals('titre du /kiosque', $this->_saved_settings['titre']); $this->assertEquals('titre du /kiosque', $this->_saved_settings['preferences']['titre']);
} }
/** @test */ /** @test */
public function profilRedirectShouldBeTwelve() { public function profilRedirectShouldBeTwelve() {
$this->assertEquals('12', $this->_saved_settings['profil_redirect']); $this->assertEquals('12', $this->_saved_settings['preferences']['profil_redirect']);
} }
} }
...@@ -759,21 +759,6 @@ class WidgetControllerVerticalNavDispatchWithMenuFromOtherTest extends WidgetCon ...@@ -759,21 +759,6 @@ class WidgetControllerVerticalNavDispatchWithMenuFromOtherTest extends WidgetCon
class WidgetControllerTagsDispatchTest extends WidgetControllerDispatchWidgetConfigurationTestCase {
public function setUp() {
$this->_type_module = 'TAGS';
parent::setUp();
}
/** @test */
public function tagSelectionChampsShouldBePresent() {
$this->assertXPathContentContains('//h2', 'Facettes disponibles');
}
}
class WidgetControllerLoginDispatchTest extends WidgetControllerDispatchWidgetConfigurationTestCase { class WidgetControllerLoginDispatchTest extends WidgetControllerDispatchWidgetConfigurationTestCase {
public function setUp() { public function setUp() {
...@@ -959,6 +944,85 @@ class WidgetControllerActivitiesPostDispatchTest extends WidgetControllerPostDis ...@@ -959,6 +944,85 @@ class WidgetControllerActivitiesPostDispatchTest extends WidgetControllerPostDis
class WidgetControllerTagsDispatchTest extends WidgetControllerDispatchWidgetConfigurationTestCase {
public function _stormHook() {
$tags = ['modules' => ['6' => ['division' => 3,
'id_module' => '6',
'type_module' => 'TAGS',
'type_tags' => 'AMDPZ',
'nombre' => 40,
'preferences' => ['type_tags' => 'AM',
'titre' => 'Des tags',
'nombre' => 10]]]];
$this
->_profil
->setCfgAccueil($tags)
->assertSave();
}
/** @test */
public function tagSelectionChampsShouldBePresent() {
$this->assertXPathContentContains('//h2', 'Facettes disponibles');
}
/** @test */
public function inputTitreShouldContainsDesTags() {
$this->assertXPath('//input[@name="titre"][@value="Des tags"]');
}
/** @test */
public function inputTypeTagsCodesShouldContainsAandM() {
$this->assertXPath('//input[@name="type_tags_codes"][@value="A;M"]');
}
/** @test */
public function inputNombreShouldHaveValueTen() {
$this->assertXPath('//input[@name="nombre"][@value="10"]');
}
}
class WidgetControllerTagsPostDispatchTest extends WidgetControllerPostDispatchWidgetConfigurationTestCase {
public function setUp() {
$this->_type_module = 'TAGS';
$this->_params = ['type_tags_codes' => 'A;M;S'];
parent::setUp();
}
/** @test */
public function typeTagsAMSShouldHaveBeenSaved() {
$this->assertEquals('AMS', $this->_saved_settings['preferences']['type_tags']);
}
/** @test */
public function typeTagsCodesAMSShouldHaveBeenRemovedFromPreferences() {
$this->assertFalse(isset($this->_saved_settings['preferences']['type_tags_codes']));
}
/** @test */
public function typeTagsCodesAMSShouldHaveBeenRemovedFromParams() {
$this->assertFalse(isset($this->_saved_settings['type_tags']));
}