From 76300a9251ea1030cb39c7c27c444f0717649b1e Mon Sep 17 00:00:00 2001 From: Ghislain Loas <ghislo@sandbox.pergame.net> Date: Fri, 27 Mar 2015 11:24:02 +0100 Subject: [PATCH] dev 17875 RGAA identation --- .../admin/controllers/AlbumController.php | 50 ++-- .../admin/controllers/I18nController.php | 10 +- library/Class/OpdsCatalog.php | 6 +- library/ZendAfi/Form.php | 8 +- library/ZendAfi/Form/Decorator/Table.php | 9 +- library/ZendAfi/View/Helper/ComboProfils.php | 16 +- library/ZendAfi/View/Helper/RenderForm.php | 22 +- .../opac/controllers/AuthControllerTest.php | 260 +++++++++--------- .../ProfilOptionsControllerTest.php | 4 +- 9 files changed, 189 insertions(+), 196 deletions(-) diff --git a/application/modules/admin/controllers/AlbumController.php b/application/modules/admin/controllers/AlbumController.php index c8e484f7be2..52f89777c2e 100644 --- a/application/modules/admin/controllers/AlbumController.php +++ b/application/modules/admin/controllers/AlbumController.php @@ -39,12 +39,12 @@ class Admin_AlbumController extends ZendAfi_Controller_Action { ->setAlbums(Class_Album::findAllBy(['cat_id' => 0])); $this->view->categories = [ [ 'bib' => Class_Bib::getPortail(), - 'containers' => $categories]]; + 'containers' => $categories]]; $this->view->containersActions = $this->_getTreeViewContainerActions(); $this->view->itemsActions = $this->_getTreeViewItemActions(); $this->view->headScript()->appendScript('var treeViewSelectedCategory = ' - . (int)$this->_getParam('cat_id') . ';' - . 'var treeViewAjaxBaseUrl = "' . $this->view->url(['action' => 'items-of']) . '"'); + . (int)$this->_getParam('cat_id') . ';' + . 'var treeViewAjaxBaseUrl = "' . $this->view->url(['action' => 'items-of']) . '"'); $this->view->headScript()->appendFile(URL_ADMIN_JS . 'tree-view.js'); } @@ -194,8 +194,8 @@ class Admin_AlbumController extends ZendAfi_Controller_Action { } $this->_renderCategoryForm( - $categorie, - 'Modification de la '. ((!$categorie->hasParentCategorie()) ? 'collection' : 'catégorie') . ' "' . $categorie->getLibelle() . '"'); + $categorie, + 'Modification de la '. ((!$categorie->hasParentCategorie()) ? 'collection' : 'catégorie') . ' "' . $categorie->getLibelle() . '"'); } @@ -219,7 +219,7 @@ class Admin_AlbumController extends ZendAfi_Controller_Action { $title .= ' dans la collection "' . $categorie->getLibelle() . '"'; $this->_renderAlbumForm( - Class_Album::newInstance()->setCategorie($categorie), $title); + Class_Album::newInstance()->setCategorie($categorie), $title); } @@ -312,7 +312,7 @@ class Admin_AlbumController extends ZendAfi_Controller_Action { public function editressourceAction() { if (null === ($ressource = Class_AlbumRessource::getLoader() - ->find($this->_getParam('id')))) { + ->find($this->_getParam('id')))) { $this->_redirect('admin/album'); return; } @@ -325,9 +325,9 @@ class Admin_AlbumController extends ZendAfi_Controller_Action { $this->view->errors = $ressource->getErrors(); $this->view->form->getElement('fichier') - ->setValue($ressource->getFichier()); + ->setValue($ressource->getFichier()); $this->view->form->getElement('poster') - ->setValue($ressource->getPoster()); + ->setValue($ressource->getPoster()); $this->view->ressource = $ressource; } @@ -379,7 +379,7 @@ class Admin_AlbumController extends ZendAfi_Controller_Action { public function massRessourceDeleteAction() { $this->_helper->getHelper('viewRenderer')->setNoRender(true); if ((!$ids = $this->_getParam('ids')) - || (!$id = $this->_getParam('id'))) { + || (!$id = $this->_getParam('id'))) { $this->_helper->notify('Paramètres manquants dans la requête de suppression'); return; } @@ -468,17 +468,17 @@ class Admin_AlbumController extends ZendAfi_Controller_Action { $cat_id = $categorie->isNew() ? $categorie->getParentId(): $categorie->getId(); $form = new ZendAfi_Form(['id' => 'categorie', 'data-backurl' => $this->view->url(['action' => 'index', - 'cat_id' => $cat_id])]); + 'cat_id' => $cat_id])]); $form->addElement(new Zend_Form_Element_Text('libelle', ['label' => 'Libellé *', 'size' => 30, 'required' => true, 'allowEmpty' => false])) - ->addDisplayGroup(['libelle'], 'categorie', - ['legend' => (($categorie->hasParentCategorie()) ? - 'Catégorie' - : 'Collection')]) - ->populate($categorie->toArray()); + ->addDisplayGroup(['libelle'], 'categorie', + ['legend' => (($categorie->hasParentCategorie()) ? + 'Catégorie' + : 'Collection')]) + ->populate($categorie->toArray()); return $form; } @@ -533,7 +533,7 @@ class Admin_AlbumController extends ZendAfi_Controller_Action { return ZendAfi_Form_Album_Ressource::newWith($ressource); } - /** + /** * @param Class_Album $album * @return null */ @@ -542,8 +542,8 @@ class Admin_AlbumController extends ZendAfi_Controller_Action { $this->view->form = $form; if ( - !$this->_request->isPost() - or !$form->isValid($this->_request->getPost()) + !$this->_request->isPost() + or !$form->isValid($this->_request->getPost()) ) return; @@ -636,9 +636,9 @@ class Admin_AlbumController extends ZendAfi_Controller_Action { $this->view->errors = $album->getErrors(); $this->view->album = $album; $this->view->form->getElement('fichier') - ->setValue($album->getFichier()); + ->setValue($album->getFichier()); $this->view->form->getElement('pdf') - ->setValue($album->getPdf()); + ->setValue($album->getPdf()); if ($this->isPopupRequest()) $this->_prepareAlbumAjaxFrom(); @@ -652,14 +652,14 @@ class Admin_AlbumController extends ZendAfi_Controller_Action { : ''; $this->view->form->beSimple() - ->setAction($this->view->url(['action' => 'link_album_to', - 'id_notice' => $id_notice])) - ->setEnctype('application/x-www-form-urlencoded'); + ->setAction($this->view->url(['action' => 'link_album_to', + 'id_notice' => $id_notice])) + ->setEnctype('application/x-www-form-urlencoded'); if (!$this->_request->isPost()) { $notice = Class_Notice::find($id_notice); $this->view->form->populateFrbrUrl( - $this->view->absoluteUrl($this->view->urlNotice($notice, [], null, true), null, true)); + $this->view->absoluteUrl($this->view->urlNotice($notice, [], null, true), null, true)); $this->view->form->getElement('titre')->setValue($notice->getTitrePrincipal()); } diff --git a/application/modules/admin/controllers/I18nController.php b/application/modules/admin/controllers/I18nController.php index dfb0ac7f4e5..13619ff4c66 100644 --- a/application/modules/admin/controllers/I18nController.php +++ b/application/modules/admin/controllers/I18nController.php @@ -45,7 +45,7 @@ class Admin_I18nController extends Zend_Controller_Action { asort($master, SORT_STRING); // et les traduction pour chaque langue configurée - $translated = array(); + $translated = []; foreach(Class_AdminVar::getLanguesWithoutDefault() as $langue) { $translated[$langue] = $this->_i18n->read($langue); @@ -79,7 +79,7 @@ class Admin_I18nController extends Zend_Controller_Action { (string)$this->_getParam('field'), (string)$this->_getParam('value')); - $this->_helper->json(array('succes' => true)); + $this->_helper->json(['succes' => true]); } @@ -87,10 +87,8 @@ class Admin_I18nController extends Zend_Controller_Action { * @return Zend_Form */ private function _getForm(array $master, array $languages) { - $form = new ZendAfi_Form(array( - 'id' => 'i18nForm', - 'method' => Zend_Form::METHOD_POST - )); + $form = new ZendAfi_Form(['id' => 'i18nForm', + 'method' => Zend_Form::METHOD_POST]); foreach ($languages as $langue => $v) { // séparation en 2 sections pour classement diff --git a/library/Class/OpdsCatalog.php b/library/Class/OpdsCatalog.php index 94797009f93..de72698b586 100644 --- a/library/Class/OpdsCatalog.php +++ b/library/Class/OpdsCatalog.php @@ -82,10 +82,10 @@ class Class_OpdsCatalog extends Storm_Model_Abstract { public function getSearchForm() { - $form = new ZendAfi_Form(array('method' => 'post')); + $form = new ZendAfi_Form(['method' => 'post']); $form - ->addElement('text', 'search', array('required' => true, - 'allowEmpty' => false)) + ->addElement('text', 'search', ['required' => true, + 'allowEmpty' => false]) ->addElement('submit', 'Rechercher'); return $form; } diff --git a/library/ZendAfi/Form.php b/library/ZendAfi/Form.php index 7657ec356b7..e0ee0177f26 100644 --- a/library/ZendAfi/Form.php +++ b/library/ZendAfi/Form.php @@ -140,10 +140,10 @@ class ZendAfi_Form extends Zend_Form { foreach($groups_definitions as $name => $definition) $this - ->addElementsFromDefinition($definition['elements']) - ->addDisplayGroup(array_keys($definition['elements']), - $name, - ['legend' => $definition['legend']]); + ->addElementsFromDefinition($definition['elements']) + ->addDisplayGroup(array_keys($definition['elements']), + $name, + ['legend' => $definition['legend']]); return $this; } diff --git a/library/ZendAfi/Form/Decorator/Table.php b/library/ZendAfi/Form/Decorator/Table.php index 7b7b8ea8254..c4cd99e5d36 100644 --- a/library/ZendAfi/Form/Decorator/Table.php +++ b/library/ZendAfi/Form/Decorator/Table.php @@ -24,18 +24,13 @@ class ZendAfi_Form_Decorator_Table extends Zend_Form_Decorator_Abstract { public function render($content) { $element = $this->getElement(); $view = $element->getView(); - if (null === $view) { + + if (null === $view) return $content; - } - $summary = $element->getAttrib('summary'); $attribs = $this->getOptions(); $name = $element->getFullyQualifiedName(); - - if ($summary) - $attribs['summary'] = $summary; - return $view->table($name, $content, $attribs); } } diff --git a/library/ZendAfi/View/Helper/ComboProfils.php b/library/ZendAfi/View/Helper/ComboProfils.php index 6f777f29b26..7bebe4b3387 100644 --- a/library/ZendAfi/View/Helper/ComboProfils.php +++ b/library/ZendAfi/View/Helper/ComboProfils.php @@ -105,17 +105,17 @@ class ZendAfi_View_Helper_ComboProfils extends ZendAfi_View_Helper_BaseHelper { public function renderBibProfils($bib, $profils) { - $html = ''; - foreach($profils as $profil) { - $libelle = $profil->getLibelle(); + $html = ''; + foreach($profils as $profil) { + $libelle = $profil->getLibelle(); - $html .= $this->renderProfilOption($profil, $libelle.': '.$this->translate()->_('Accueil')); + $html .= $this->renderProfilOption($profil, $libelle.': '.$this->translate()->_('Accueil')); - foreach ($profil->getSubProfils() as $page) - $html .= $this->renderProfilOption($page, $libelle.': '.$page->getLibelle()); - } + foreach ($profil->getSubProfils() as $page) + $html .= $this->renderProfilOption($page, $libelle.': '.$page->getLibelle()); + } - return '<optgroup label="'.htmlentities($bib).'">'.$html.'</optgroup>'; + return '<optgroup label="'.htmlentities($bib).'">'.$html.'</optgroup>'; } diff --git a/library/ZendAfi/View/Helper/RenderForm.php b/library/ZendAfi/View/Helper/RenderForm.php index cab95f461e4..bda24631920 100644 --- a/library/ZendAfi/View/Helper/RenderForm.php +++ b/library/ZendAfi/View/Helper/RenderForm.php @@ -81,15 +81,15 @@ class ZendAfi_View_Helper_RenderForm extends ZendAfi_View_Helper_BaseHelper { protected function _decoratorsForTableRendering($element) { - $newDecorators = array(); - $decorators = $element->getDecorators(); + $newDecorators = array(); + $decorators = $element->getDecorators(); - foreach ($decorators as $name => $decorator) { - $name = explode('_', $name); - $name = end($name); - $name = strtolower($name); + foreach ($decorators as $name => $decorator) { + $name = explode('_', $name); + $name = end($name); + $name = strtolower($name); - switch ($name) { + switch ($name) { case 'label': $newDecorators[] = array(array('input_data' => 'HtmlTag'), array('tag' => 'td', 'class' => 'gauche')); @@ -116,10 +116,10 @@ class ZendAfi_View_Helper_RenderForm extends ZendAfi_View_Helper_BaseHelper { default: $newDecorators[$name] = $decorator; break; - } } + } - return $newDecorators; + return $newDecorators; } @@ -149,7 +149,7 @@ class ZendAfi_View_Helper_RenderForm extends ZendAfi_View_Helper_BaseHelper { */ protected function _getBackUrl($form) { return ($form->getAttrib('data-backurl')) ? - $form->getAttrib('data-backurl') : - $this->view->url(['action' => 'index']); + $form->getAttrib('data-backurl') : + $this->view->url(['action' => 'index']); } } \ No newline at end of file diff --git a/tests/application/modules/opac/controllers/AuthControllerTest.php b/tests/application/modules/opac/controllers/AuthControllerTest.php index 486c9197300..8c5a5095856 100644 --- a/tests/application/modules/opac/controllers/AuthControllerTest.php +++ b/tests/application/modules/opac/controllers/AuthControllerTest.php @@ -102,12 +102,12 @@ class AuthControllerAbonneSIGBLoggedTest extends PortailWithOneLoginModuleTestCa ->reservationsAddAll(array(Class_WebService_SIGB_Reservation::newInstanceWithEmptyExemplaire())); ZendAfi_Auth::getInstance()->logUser( - Class_Users::newInstanceWithId(5, - ['login' => 'patrick', - 'idabon' => 456, - 'role_level' => ZendAfi_Acl_AdminControllerRoles::ABONNE_SIGB, - 'id_site' => 1, - 'fiche_sigb' => ['fiche' => $this->emprunteur_patrick]])); + Class_Users::newInstanceWithId(5, + ['login' => 'patrick', + 'idabon' => 456, + 'role_level' => ZendAfi_Acl_AdminControllerRoles::ABONNE_SIGB, + 'id_site' => 1, + 'fiche_sigb' => ['fiche' => $this->emprunteur_patrick]])); @@ -155,7 +155,7 @@ class AuthControllerAbonneSIGBLoggedTest extends PortailWithOneLoginModuleTestCa class AuthControllerAbonneSIGBLoggedLogoutTest -extends PortailWithOneLoginModuleTestCase { + extends PortailWithOneLoginModuleTestCase { public function setUp() { parent::setUp(); $this->dispatch('/opac/auth/logout'); @@ -171,7 +171,7 @@ extends PortailWithOneLoginModuleTestCase { class AuthControllerWithProfilPageAbonneSIGBLoggedLogoutTest -extends PortailWithOneLoginModuleTestCase { + extends PortailWithOneLoginModuleTestCase { protected $_profile, $_parent_profile; public function setUp() { @@ -268,7 +268,7 @@ class AuthControllerNobodyLoggedActivateTest extends AuthControllerNobodyLoggedT class AuthControllerNobodyLoggedAndRegistrationAllowedBoiteLoginTest -extends AuthControllerNobodyLoggedTestCase { + extends AuthControllerNobodyLoggedTestCase { public function setUp() { parent::setUp(); @@ -398,9 +398,9 @@ class AuthControllerNobodyLoggedAndRegistrationAllowedAjaxLoginTest extends Auth '//div//a[contains(@href, "auth/register")]'); $this->_xpath->assertXPathContentContains( - $this->_json->content, - '//div//a[contains(@href, "auth/register")]', - "S'enregistrer"); + $this->_json->content, + '//div//a[contains(@href, "auth/register")]', + "S'enregistrer"); } @@ -588,12 +588,12 @@ class AuthControllerUserIsLoggedTest extends PortailWithOneLoginModuleTestCase { public function setUp() { parent::setUp(); $marcus = $this->fixture('Class_Users', [ - 'id' => 1, - 'pseudo' => '', - 'login' => 'sysadm', - 'password' => 'sysadmPassword', - 'nom' => 'Miller', - 'prenom' => 'Marcus']); + 'id' => 1, + 'pseudo' => '', + 'login' => 'sysadm', + 'password' => 'sysadmPassword', + 'nom' => 'Miller', + 'prenom' => 'Marcus']); ZendAfi_Auth::getInstance()->logUser($marcus); $this->dispatch('/opac/auth/login',true); } @@ -609,12 +609,12 @@ class AuthControllerUserNameIsEscaped extends PortailWithOneLoginModuleTestCase public function setUp() { parent::setUp(); $marcus = $this->fixture('Class_Users', - ['id' => 1, - 'pseudo' => '', - 'login' => 'sysadm', - 'password' => 'sysadmPassword', - 'nom' => '<script>Miller', - 'prenom' => '<script>Marcus']); + ['id' => 1, + 'pseudo' => '', + 'login' => 'sysadm', + 'password' => 'sysadmPassword', + 'nom' => '<script>Miller', + 'prenom' => '<script>Marcus']); ZendAfi_Auth::getInstance()->logUser($marcus); $this->dispatch('/opac/auth/login',true); } @@ -636,12 +636,12 @@ class AuthControllerPseudoIsEscaped extends PortailWithOneLoginModuleTestCase { public function setUp() { parent::setUp(); $marcus = $this->fixture('Class_Users', - ['id' => 1, - 'pseudo' => '<script>pseudo', - 'login' => 'sysadm', - 'password' => 'sysadmPassword', - 'nom' => 'Miller', - 'prenom' => 'Marcus']); + ['id' => 1, + 'pseudo' => '<script>pseudo', + 'login' => 'sysadm', + 'password' => 'sysadmPassword', + 'nom' => 'Miller', + 'prenom' => 'Marcus']); ZendAfi_Auth::getInstance()->logUser($marcus); $this->dispatch('/opac/auth/login',true); } @@ -861,7 +861,7 @@ abstract class AuthControllerPostSimpleSuccessfulTestCase extends AuthController $this->group_musicme = $this->fixture('Class_UserGroup', ['id' => 20, 'libelle' => 'Multimedia']) - ->addRight(Class_UserGroup::RIGHT_ACCES_MUSICME); + ->addRight(Class_UserGroup::RIGHT_ACCES_MUSICME); $marcel = Class_Users::newInstanceWithId(2, ['nom' => 'Marcel','login' =>'foo']) ->beAbonneSIGB() @@ -871,10 +871,10 @@ abstract class AuthControllerPostSimpleSuccessfulTestCase extends AuthController ->whenCalled('authenticateLoginPassword') ->with('foo', 'bar') ->willDo( - function() use($marcel) { - $this->_auth->whenCalled('getIdentity')->answers($marcel); - return true; - }); + function() use($marcel) { + $this->_auth->whenCalled('getIdentity')->answers($marcel); + return true; + }); $this->_web_analytics_client = Storm_Test_ObjectWrapper::mock() @@ -1343,12 +1343,12 @@ class AuthControllerNobodyLoggedRegisterPostWrongDataTest extends AuthController public function fields() { return [ - ['login',], - ['mail'], - ['mail2'], - ['mdp'], - ['mdp2'], - ]; + ['login',], + ['mail'], + ['mail2'], + ['mdp'], + ['mdp2'], + ]; } @@ -1453,14 +1453,14 @@ class PortailWithOneLoginModuleTestAndLoggedUserCase extends AbstractControllerT 'id_module' => 4, 'type_module' => 'LOGIN', 'preferences' => [ - 'identifiant' => 'Numéro de carte', - 'mot_de_passe'=> 'Année de naissance', - 'identifiant_exemple' => 'jj-mm-aaaa', - 'mot_de_passe_exemple' => '1983', - 'titre_connecte' => 'Vous êtes connecté(e)', - 'lien_connexion' => 'please, log me', - 'lien_mot_de_passe_oublie' => 'me rappelle plus', - 'profil_redirect' => 0]]], + 'identifiant' => 'Numéro de carte', + 'mot_de_passe'=> 'Année de naissance', + 'identifiant_exemple' => 'jj-mm-aaaa', + 'mot_de_passe_exemple' => '1983', + 'titre_connecte' => 'Vous êtes connecté(e)', + 'lien_connexion' => 'please, log me', + 'lien_mot_de_passe_oublie' => 'me rappelle plus', + 'profil_redirect' => 0]]], 'options' => []]; Class_Profil::getCurrentProfil() @@ -1469,14 +1469,14 @@ class PortailWithOneLoginModuleTestAndLoggedUserCase extends AbstractControllerT ZendAfi_Auth::getInstance()->logUser( - $this->fixture('Class_Users', - ['id' => 5, - 'login' => 'Pioup', - 'idabon' => 48, - 'password' => 'one ok password', - 'role_level' => ZendAfi_Acl_AdminControllerRoles::ABONNE_SIGB, - 'id_site' => 1, - 'fiche_sigb' => []])); + $this->fixture('Class_Users', + ['id' => 5, + 'login' => 'Pioup', + 'idabon' => 48, + 'password' => 'one ok password', + 'role_level' => ZendAfi_Acl_AdminControllerRoles::ABONNE_SIGB, + 'id_site' => 1, + 'fiche_sigb' => []])); $this->dispatch('/opac/'); } @@ -1511,38 +1511,38 @@ class PortailWithOneLoginModuleTestAndLoggedUserCase extends AbstractControllerT - class AuthControllerAbonneSIGBNotValidLoggedTest extends PortailWithOneLoginModuleTestCase { - public function setUp() { - parent::setUp(); +class AuthControllerAbonneSIGBNotValidLoggedTest extends PortailWithOneLoginModuleTestCase { + public function setUp() { + parent::setUp(); - ZendAfi_Auth::getInstance()->logUser( - Class_Users::newInstanceWithId(5, - ['login' => 'tomato', - 'idabon' => 48, - 'role_level' => ZendAfi_Acl_AdminControllerRoles::ABONNE_SIGB, - 'id_site' => 1, - 'date_fin' => '2014-01-01', - 'fiche_sigb' => []])); + ZendAfi_Auth::getInstance()->logUser( + Class_Users::newInstanceWithId(5, + ['login' => 'tomato', + 'idabon' => 48, + 'role_level' => ZendAfi_Acl_AdminControllerRoles::ABONNE_SIGB, + 'id_site' => 1, + 'date_fin' => '2014-01-01', + 'fiche_sigb' => []])); - $this->dispatch('/opac/'); - } + $this->dispatch('/opac/'); + } - /** @test */ - public function shouldDisplayExpiredSubscription() { - $this->assertXPathContentContains('//div[@class="boite login"]//p[@class="expired"]', 'Abonnement expiré - Merci de contacter la médiathèque'); - } + /** @test */ + public function shouldDisplayExpiredSubscription() { + $this->assertXPathContentContains('//div[@class="boite login"]//p[@class="expired"]', 'Abonnement expiré - Merci de contacter la médiathèque'); } +} class AuthControllerNobodyLoggedAndRegisterNewsletterWithNoNewsletterTest extends AuthControllerNobodyLoggedTestCase { public function setUp() { - parent::setUp(); + parent::setUp(); - $this->dispatch('/opac/auth/newsletter-register', true); - } + $this->dispatch('/opac/auth/newsletter-register', true); + } /** @test */ @@ -1556,10 +1556,10 @@ class AuthControllerNobodyLoggedAndRegisterNewsletterWithNoNewsletterTest extend class AuthControllerNobodyLoggedAndRegisterNewsletterWithWrongNewsletterTest extends AuthControllerNobodyLoggedTestCase { public function setUp() { - parent::setUp(); - Class_Newsletter::beVolatile(); - $this->dispatch('/opac/auth/newsletter-register/id/1', true); - } + parent::setUp(); + Class_Newsletter::beVolatile(); + $this->dispatch('/opac/auth/newsletter-register/id/1', true); + } /** @test */ @@ -1574,15 +1574,15 @@ class AuthControllerNobodyLoggedAndRegisterNewsletterWithWrongNewsletterTest ext class AuthControllerNewsletterRegisterKickSpamBotsTest extends AuthControllerNobodyLoggedTestCase { public function setUp() { - parent::setUp(); - $this->fixture('Class_Newsletter', - ['id' => 5, - 'titre' => 'Daily News']); + parent::setUp(); + $this->fixture('Class_Newsletter', + ['id' => 5, + 'titre' => 'Daily News']); - $this->postDispatch('/opac/auth/newsletter-register/id/5', [ - 'email' => 'imnotabot@factory.bot', - 'emailCheck' => 'imnotabot@factory.bot']); - } + $this->postDispatch('/opac/auth/newsletter-register/id/5', [ + 'email' => 'imnotabot@factory.bot', + 'emailCheck' => 'imnotabot@factory.bot']); + } /** @test */ @@ -1597,13 +1597,13 @@ class AuthControllerNewsletterRegisterKickSpamBotsTest extends AuthControllerNob class AuthControllerNobodyLoggedAndRegisterNewsletterTest extends AuthControllerNobodyLoggedTestCase { public function setUp() { - parent::setUp(); - $this->fixture('Class_Newsletter', - ['id' => 5, - 'titre' => 'Daily News']); + parent::setUp(); + $this->fixture('Class_Newsletter', + ['id' => 5, + 'titre' => 'Daily News']); - $this->dispatch('/opac/auth/newsletter-register/id/5', true); - } + $this->dispatch('/opac/auth/newsletter-register/id/5', true); + } /** @test */ @@ -1657,7 +1657,7 @@ class AuthControllerPostRegisterNewsletterDailyNewsTest extends AuthControllerNo $this->postDispatch('/opac/auth/newsletter-register/id/5', ['email' => 'iwanttobespamed@abo.com', 'emailCheck' => '']); - } + } protected function getSentMail() { @@ -1746,30 +1746,30 @@ class AuthControllerPostRegisterNewsletterDailyNewsTest extends AuthControllerNo class AuthControllerPostRegisterNewsletterDailyNewsWithNonUniqueMailTest extends AuthControllerNobodyLoggedTestCase { public function setUp() { - parent::setUp(); + parent::setUp(); - $this->fixture('Class_Users', - ['id' => 1, - 'login' => 'Tom', - 'password' => 'pwd', - 'mail' => 'imalreadyused@mail.com']); + $this->fixture('Class_Users', + ['id' => 1, + 'login' => 'Tom', + 'password' => 'pwd', + 'mail' => 'imalreadyused@mail.com']); - Class_UsersNonValid::beVolatile(); + Class_UsersNonValid::beVolatile(); - $this->fixture('Class_Newsletter', - ['id' => 5, - 'titre' => 'Daily News']); + $this->fixture('Class_Newsletter', + ['id' => 5, + 'titre' => 'Daily News']); - $this->postDispatch('/opac/auth/newsletter-register/id/5', [ - 'email' => 'imalreadyused@mail.com', - 'emailCheck' => '']); - } + $this->postDispatch('/opac/auth/newsletter-register/id/5', [ + 'email' => 'imalreadyused@mail.com', + 'emailCheck' => '']); + } /** @test */ public function shouldReturnNonUniqueMailMessage() { $this->assertXPathContentContains('//span[@class="error"]', - "Un utilisateur a déjà renseigné cet email. Merci de vous identifier avec le compte qui utilise cet email."); + "Un utilisateur a déjà renseigné cet email. Merci de vous identifier avec le compte qui utilise cet email."); } @@ -1841,8 +1841,8 @@ class AuthControllerNewsletterActiveUserWithWrongParamsTest extends AuthControll /** @test */ public function wrongKeyShouldDisplayExpectedMessage() { $this->fixture('Class_Newsletter', - ['id' => 1, - 'titre' => 'News of the month']); + ['id' => 1, + 'titre' => 'News of the month']); $this->dispatch('opac/auth/newsletter-active-user/c/4897sd8fsdf/id/1', true); $this->assertXPathContentContains('//p', 'Inscription à la newsletter invalide.'); @@ -1860,22 +1860,22 @@ class AuthControllerNewsletterActiveUserTest extends AuthControllerNoBodyLoggedT Class_Users::beVolatile(); $this->fixture('Class_Newsletter',[ - 'id' => 1, - 'titre' => 'News of the month']); + 'id' => 1, + 'titre' => 'News of the month']); $this->fixture('Class_UsersNonValid', [ - 'id' => 1, - 'login' => 'future@i.am', - 'mail' => 'future@i.am', - 'password' => 'random', - 'cle' => '12345678']); + 'id' => 1, + 'login' => 'future@i.am', + 'mail' => 'future@i.am', + 'password' => 'random', + 'cle' => '12345678']); $this->fixture('Class_UsersNonValid', [ - 'id' => 2, - 'login' => 'future@i.am', - 'mail' => 'future@i.am', - 'password' => 'random', - 'cle' => '12345678']); + 'id' => 2, + 'login' => 'future@i.am', + 'mail' => 'future@i.am', + 'password' => 'random', + 'cle' => '12345678']); $this->dispatch('opac/auth/newsletter-active-user/c/12345678/id/1', true); } @@ -2003,16 +2003,16 @@ class AuthControllerNewsletterUnsubscribeTest extends AbstractControllerTestCase parent::setUp(); $tomato = $this->fixture('Class_Users', - ['id' => 156, - 'login' => 'tomato', - 'password' => 'pwd']); + ['id' => 156, + 'login' => 'tomato', + 'password' => 'pwd']); ZendAfi_Auth::getInstance() ->logUser($tomato); $daily_news = $this->fixture('Class_Newsletter', - ['id' => 1, - 'titre' => 'Daily News']); + ['id' => 1, + 'titre' => 'Daily News']); $subscription = $this->fixture('Class_NewsletterSubscription', ['id' => 1]); diff --git a/tests/application/modules/opac/controllers/ProfilOptionsControllerTest.php b/tests/application/modules/opac/controllers/ProfilOptionsControllerTest.php index d88253c8448..630d860c892 100644 --- a/tests/application/modules/opac/controllers/ProfilOptionsControllerTest.php +++ b/tests/application/modules/opac/controllers/ProfilOptionsControllerTest.php @@ -1112,7 +1112,7 @@ class ProfilOptionsControllerPageJeuxViewModuleCritiquesTest extends ProfilOptio */ public function breadcrumbShouldNotContainsSpanProfilJeunesse() { $this->assertNotXPathContentContains('//div[@class="barre_nav"]//span', - 'Jeunesse',$this->_response->getBody()); + 'Jeunesse',$this->_response->getBody()); } @@ -1195,7 +1195,7 @@ class ProfilOptionsControllerProfilBreadcrumbHomePageTest extends ProfilOptionsC */ public function breadcrumbShouldNotContainsSpanProfilHomePage() { $this->assertNotXPathContentContains('//div[@class="barre_nav"]//span', - 'HomePage',$this->_response->getBody()); + 'HomePage',$this->_response->getBody()); } } -- GitLab