diff --git a/VERSIONS b/VERSIONS index 61a040e59abaaf5c5d8cb78943e943fcec47b7bd..1dea15c9cc588c2294a48b0e0754946fbeafaaae 100644 --- a/VERSIONS +++ b/VERSIONS @@ -1,6 +1,9 @@ +- ticket #14860: corrige l'apparition d'une double icône de lancement des batchs dans l'interface d'administration +- ticket #14805: lorsqu'on ajoute une catégorie d'article dans une bibliothèque, le bouton retour réouvre l'arborescence des catégories sur cette bibliothèque + SIGB Pergame - ticket #14092 : correction du code de support renvoyé par l'opac lors des réservation - +- ticket #14462 : correction de l'affichage du message lorsqu'une réservation n'est pas possible (quota d'abonnement ou de document atteint) 26/06/2014 - v6.46.3 - ticket #14515: Autorise l'utilisation de fichiers de police au format OTF diff --git a/application/modules/admin/controllers/CmsController.php b/application/modules/admin/controllers/CmsController.php index 3616c7fd133007c913ecbc4bc05d0e6e751a8b29..973c8e28b282f60d4981b19f63459f3dfe57821b 100644 --- a/application/modules/admin/controllers/CmsController.php +++ b/application/modules/admin/controllers/CmsController.php @@ -94,11 +94,12 @@ class Admin_CmsController extends ZendAfi_Controller_Action { } if ($this->_isCategorySaved($category)) { - $this->_redirect(sprintf('admin/cms/index/id_cat/%d', $category->getIdCatMere())); + $this->_redirect(sprintf('admin/cms/index/id_cat/%d', $category->getId())); return; } $this->view->category = $category; + $this->view->id_categorie = (int)$this->_getParam('id'); $this->view->titre = "Ajouter une catégorie d'articles"; } @@ -116,7 +117,7 @@ class Admin_CmsController extends ZendAfi_Controller_Action { $this->view->category = $category; $this->view->combo_cat = $this->view->comboParentCategorie($category); - + $this->view->id_categorie = (int)$this->_getParam('id'); $this->view->titre = "Modifier une catégorie d'articles"; } @@ -224,7 +225,7 @@ class Admin_CmsController extends ZendAfi_Controller_Action { $this->_redirect('admin/cms'); return; } - + xdebug_break(); $this->_article_old_status = $article->getStatus(); if (null === ($article->getCategorie()->getBib())) $article->getCategorie()->setBib($this->_bib); diff --git a/application/modules/admin/views/scripts/batch/index.phtml b/application/modules/admin/views/scripts/batch/index.phtml index fb4df603bd63679646427a9ff0f36cb8f92a00fe..3193b38b3bd0040a1841dd157a600aa77563540e 100644 --- a/application/modules/admin/views/scripts/batch/index.phtml +++ b/application/modules/admin/views/scripts/batch/index.phtml @@ -10,9 +10,15 @@ echo $this->tagModelTable( $this->batchs, [$this->_('Libelle'), $this->_('Dernière exécution')], ['Libelle', 'last_run'], - [['action' => 'delete', 'content' => $this->boutonIco('type=del')], - ['action' => 'run', 'content' => $this->boutonIco('type=test')], - ['action' => 'run-ajax', 'content' => $this->boutonIco('type=test')] ], + [ + ['action' => 'delete', 'content' => $this->boutonIco('type=del')], + function($batch) { + $action = (in_array($batch->getType(), + ['AUTOCOMPLETE_RECORD_TITLE', 'AUTOCOMPLETE_RECORD_AUTHOR'])) ? + 'run-ajax' : 'run'; + return $this->tagAnchor(['action' => $action, 'id' => $batch->getId()], + $this->boutonIco('type=test', 'bulle=Lancer')); + }], 'batchs'); ?> diff --git a/application/modules/admin/views/scripts/cms/_newsform_buttons.phtml b/application/modules/admin/views/scripts/cms/_newsform_buttons.phtml index 64c52e39cafd25d6efec503747fbfd8d67d3cab4..ead84c9d60d28adf9955e7341d9775ee6b877a69 100644 --- a/application/modules/admin/views/scripts/cms/_newsform_buttons.phtml +++ b/application/modules/admin/views/scripts/cms/_newsform_buttons.phtml @@ -8,7 +8,7 @@ echo $this->boutonRetour(['module' => 'admin', 'controller' => 'cms', 'action' => 'index', - 'id_cat' => $this->id_categorie]); + 'id_cat' => $this->article->getCategorie()->getId()]); ?> </td> </tr> diff --git a/application/modules/admin/views/scripts/cms/catform.phtml b/application/modules/admin/views/scripts/cms/catform.phtml index 8a967e93eab97f13d923d130ed014dfc371f7ba9..7a004793c07c3dc7edaa35110f89823aa45f7012 100644 --- a/application/modules/admin/views/scripts/cms/catform.phtml +++ b/application/modules/admin/views/scripts/cms/catform.phtml @@ -24,7 +24,16 @@ <table> <tr> <td align="right" style="padding-right:5px;"><?php echo $this->bouton('type=V'); ?> </td> - <td align="left" style="padding-left:5px;"> <?php echo $this->bouton('id=c_2', 'picto=del.gif', 'texte=Annuler', 'url='.BASE_URL.'/admin/cms', 'largeur=120px'); ?></td> + <td align="left" style="padding-left:5px;"> + <?php echo $this->bouton('id=c_2', + 'picto=del.gif', + 'texte=Annuler', + 'url='.$this->url(['controller' => 'cms', + 'action' => 'index', + 'id' => null, + 'id_cat' => $this->id_categorie]), + 'largeur=120px'); ?> + </td> </tr> </table> </tr> diff --git a/application/modules/admin/views/scripts/cms/newsform.phtml b/application/modules/admin/views/scripts/cms/newsform.phtml index 1d44a5a4853d7ddd66172aa68e7bc0b94ea440de..43782e8e4b8c9a7cfeed4ce1aec76a8e452f5d9f 100644 --- a/application/modules/admin/views/scripts/cms/newsform.phtml +++ b/application/modules/admin/views/scripts/cms/newsform.phtml @@ -226,7 +226,8 @@ echo $this->article->getRefusMessage(); ?></textarea> </fieldset> <?php } ?> - <?php echo $this->partial('cms/_newsform_buttons.phtml',['id_categorie'=> $this->article->getCategorie()->getId()]); ?> + <?php echo $this->partial('cms/_newsform_buttons.phtml', + ['article' => $this->article]); ?> </form> <script type="text/javascript"> diff --git a/application/modules/admin/views/scripts/cms/traductionform.phtml b/application/modules/admin/views/scripts/cms/traductionform.phtml index ff0541b45ffab4f70a7d17e2102dc45cb0420fb1..68f74a2831e176172fbc801064d1ce7295275848 100644 --- a/application/modules/admin/views/scripts/cms/traductionform.phtml +++ b/application/modules/admin/views/scripts/cms/traductionform.phtml @@ -47,7 +47,8 @@ </fieldset> <?php } ?> - <?php echo $this->partial('cms/_newsform_buttons.phtml',['id_categorie'=> $this->article->getCategorie()->getId()]); ?> + <?php echo $this->partial('cms/_newsform_buttons.phtml', + ['article'=> $this->article]); ?> </form> diff --git a/application/modules/opac/views/scripts/head.phtml b/application/modules/opac/views/scripts/head.phtml index 25193a1898d7a87ba547e5081ac074019c743aaa..d20f9e0c1ddccb4a8670bf2ad6c8178e89b0e50f 100644 --- a/application/modules/opac/views/scripts/head.phtml +++ b/application/modules/opac/views/scripts/head.phtml @@ -58,13 +58,15 @@ if ($this->header_css && $current_profil->getUseParentCss() && !$current_profil->hasPageCss()) - $head_scripts->addStyleSheet($this->header_css, ['id' => 'profil_css']); + $head_scripts->addStyleSheet($this->header_css, ['id' => 'profil_css', + 'media' => 'all']); if ($this->header_css && $current_profil->getUseParentCss() && $current_profil->hasPageCss()) $head_scripts->addStyleSheet($this->header_css); if($current_profil->hasPageCss()) - $head_scripts->addStyleSheet($current_profil->getPageCss(), ['id' => 'profil_css']); + $head_scripts->addStyleSheet($current_profil->getPageCss(), ['id' => 'profil_css', + 'media' => 'all']); if ($this->accessibilite_on) { //Feuilles de styles pour les déficiences visuelles diff --git a/library/Class/Profil.php b/library/Class/Profil.php index 18f247c3927c988ebc855595cd6cbfad2bc68e2e..1cd309dca953daa750e5f36e524bc7030dd859b0 100644 --- a/library/Class/Profil.php +++ b/library/Class/Profil.php @@ -192,15 +192,15 @@ class Class_Profil extends Storm_Model_Abstract { 'menus' => []]]), 'cfg_modules' => '', 'cfg_notice' => ZendAfi_Filters_Serialize::serialize(['exemplaires' => ['grouper' => 0, - 'annexe' => 0, - 'bib' => 1, - 'section' => 0, - 'emplacement' => 0, - 'localisation' => 1, - 'plan' => 1, - 'resa' => 1, - 'dispo' => 1, - 'date_retour' => 0], + 'annexe' => 0, + 'bib' => 1, + 'section' => 0, + 'emplacement' => 0, + 'localisation' => 1, + 'plan' => 1, + 'resa' => 1, + 'dispo' => 1, + 'date_retour' => 0], 'en_pret' => 'En prêt']), 'hauteur_banniere' => 100, 'mail_site' => '', @@ -684,6 +684,14 @@ class Class_Profil extends Storm_Model_Abstract { } + /** + * @return array + */ + public function getDefaultCfgNotice() { + return $this->_unserialize(self::getDefaultValue('cfg_notice')); + } + + public function getDefaultCfgAccueil() { return $this->_unserialize(self::getDefaultValue('cfg_accueil')); } @@ -1837,4 +1845,4 @@ class Class_Profil extends Storm_Model_Abstract { } } -?> \ No newline at end of file +?> diff --git a/library/Class/ScriptLoader.php b/library/Class/ScriptLoader.php index f4dfeb605dcc1da9f4c712f1f35c3befb75b3951..dae2ab2840bc3ad0fc1a1823df36affb70bfc6b3 100644 --- a/library/Class/ScriptLoader.php +++ b/library/Class/ScriptLoader.php @@ -416,7 +416,7 @@ class Class_ScriptLoader { public function addUserFilesStylSheet($file, $additional_attributes=null) { if (!$file || !file_exists(USERFILESPATH.'/css/' . $file)) return $this; - return $this->addStyleSheet(USERFILESURL . '/css/' . $file, $additional_attributes); + return $this->addStyleSheet(USERFILESURL . '/css/' . $file, array_merge(['media' => 'all'], $additional_attributes)); } diff --git a/library/Class/Systeme/PergameService.php b/library/Class/Systeme/PergameService.php index b70300ea2bfa315b43b0a3c862b8078124dcd2e8..922e32feaf8376b999919dfb8b164a8935bea5c5 100644 --- a/library/Class/Systeme/PergameService.php +++ b/library/Class/Systeme/PergameService.php @@ -210,12 +210,12 @@ class Class_Systeme_PergameService { // controle quota par carte $nb = Class_Reservation::countBy(['idabon' => $id_abon]); if ($nb >= $regles['Max_par_carte']) - return ['popup' => 'La réservation est impossible car vous avez atteint le nombre maximum de réservations sur votre carte.']; + return ['erreur' => 'La réservation est impossible car vous avez atteint le nombre maximum de réservations sur votre carte.']; // controle quota par document $nb = Class_Reservation::countBy(['id_notice_origine' => $id_origine]); if ($nb >= $regles['Max_par_document']) - return ['popup' => 'La réservation est impossible car le nombre maximum de réservations pour ce document a été atteint (' . $regles["Max_par_document"] . ').']; + return ['erreur' => 'La réservation est impossible car le nombre maximum de réservations pour ce document a été atteint (' . $regles["Max_par_document"] . ').']; if (!$id_bib) $id_bib = 1; diff --git a/library/ZendAfi/View/Helper/BoutonIco.php b/library/ZendAfi/View/Helper/BoutonIco.php index 258e5d427e8a54f0d5fb294c855a1fb7f754f652..81b15b6b3ca3b1c03526124888d4e034502a4fe7 100644 --- a/library/ZendAfi/View/Helper/BoutonIco.php +++ b/library/ZendAfi/View/Helper/BoutonIco.php @@ -18,83 +18,66 @@ * 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 */ -////////////////////////////////////////////////////////////////////////////////////////// -// OPAC3 : Bouton image -////////////////////////////////////////////////////////////////////////////////////////// -class ZendAfi_View_Helper_BoutonIco extends ZendAfi_View_Helper_BaseHelper -{ - //---------------------------------------------------------------------------------- - // Main (arguments variables) - //---------------------------------------------------------------------------------- - function boutonIco() { - for( $i=0; $i < func_num_args(); $i++) $args[] = func_get_arg($i); - $type = ''; - // Recup des paramètres - for($i=0; $i< count($args); $i++) - { - $attrib = $this->splitArg($args[$i]); - switch($attrib[0]) - { - case "picto" : $picto=URL_ADMIN_IMG.$attrib[1]; break; - case "url" : $url=BASE_URL. "/". $attrib[1]; break; - case "bulle" : $bulle=$this->traduire($attrib[1]); break; - case "mailto" : $url='mailto:'.$attrib[1]; break; - case "type" : // Types prédéterminés - $type=strtoupper($attrib[1]); +class ZendAfi_View_Helper_BoutonIco extends ZendAfi_View_Helper_BaseHelper { + public function boutonIco() { + $this->type = $this->url = $this->picto = $this->bulle = ''; + $this->delete = false; - if($type=="ADD") - { - $picto=URL_ADMIN_IMG."ico/add.gif"; - $bulle=$this->traduire("Ajouter"); - } - elseif($type=="EDIT") - { - $picto=URL_ADMIN_IMG."ico/edit.gif"; - $bulle=$this->traduire("Modifier"); - } - elseif($type=="DEL") - { - $picto=URL_ADMIN_IMG."ico/del.gif"; - $bulle=$this->traduire("Supprimer"); - } - elseif($type=="CONFIRM") - { - $picto=URL_ADMIN_IMG."ico/coche_verte.gif"; - $bulle=$this->traduire("Confirmer"); - } - elseif($type=="VALIDATE") - { - $picto=URL_ADMIN_IMG."ico/coche_verte.gif"; - $bulle=$this->traduire("Valider"); - } - elseif($type=="TEST") - { - $picto=URL_ADMIN_IMG."ico/tester.gif"; - $bulle=$this->traduire("Tester"); - } - elseif($type=="SHOW") - { - $picto=URL_ADMIN_IMG."ico/show.gif"; - $bulle=$this->traduire("Visualiser"); - } - elseif($type=="MAIL") - { - $picto=URL_ADMIN_IMG."ico/mail.png"; - $bulle=$this->traduire("Envoyer par mail"); - } - break; - } + $mapping = [ + 'picto' => function($value) {$this->picto = URL_ADMIN_IMG . $value;}, + 'url' => function($value) {$this->url = BASE_URL . '/' . $value;}, + 'bulle' => function($value) {$this->bulle = $this->traduire($value);}, + 'mailto' => function($value) {$this->url = 'mailto:' . $value;}, + 'type' => function($value) {$this->predefined($value);} + ]; + + $args[] = func_get_args(); + foreach (func_get_args() as $arg) { + $attrib = $this->splitArg($arg); + $name = $attrib[0]; + $value = $attrib[1]; + if (array_key_exists($name, $mapping)) + $mapping[$name]($value); + } + + + $options = [ + 'src' => $this->picto, + 'class' => 'ico']; + + if ($this->bulle) { + $options['alt'] = $this->bulle; + $options['title'] = $this->bulle; } - - // Html du bouton - if(isset($url)) $html[]='<a href="'. $url .'">'; - $html[]='<img class="ico" src="'. $picto .'"'; - if(isSet($bulle)) $html[]=' alt="'.$bulle.'" title="'.$bulle.'"'; - if($type=="DEL") $html[]=' onclick="javascript:if(!confirm(\''.$this->traduire('Êtes vous sûr de vouloir supprimer cet élément ?').'\')) return false;"'; - $html[]=' />'; - if(isSet($url)) $html[]='</a>'; - return implode("", $html); + if ('DEL' == strtoupper($this->type)) + $options['onclick'] = 'javascript:return confirm(\'' . $this->traduire('Êtes vous sûr de vouloir supprimer cet élément ?') . '\');'; + + $html = $this->view->tag('img', null, $options); + + return ($this->url) ? + $this->view->tag('a', $html, ['href' => $this->url]) : + $html; + } + + + protected function predefined($type) { + $mapping = [ + 'ADD' => ['add.gif', $this->traduire('Ajouter')], + 'EDIT'=> ['edit.gif', $this->traduire('Modifier')], + 'DEL' => ['del.gif', $this->traduire('Supprimer')], + 'CONFIRM'=> ['coche_verte.gif', $this->traduire('Confirmer')], + 'VALIDATE' => ['coche_verte.gif', $this->traduire('Valider')], + 'TEST' => ['tester.gif', $this->traduire('Tester')], + 'SHOW' => ['show.gif', $this->traduire('Visualiser')], + 'MAIL' => ['mail.png', $this->traduire('Envoyer par mail')] + ]; + + $type = strtoupper($type); + if (array_key_exists($type, $mapping)) { + $this->picto = URL_ADMIN_IMG . 'ico/' . $mapping[$type][0]; + $this->bulle = $mapping[$type][1]; + } } } \ No newline at end of file diff --git a/public/opac/css/print.css b/public/opac/css/print.css index 378073c896ba52b0870d5ae3d617b81e84ad48a2..cc7bfc00e08606287a761745607da1b3866b83e6 100644 --- a/public/opac/css/print.css +++ b/public/opac/css/print.css @@ -10,30 +10,30 @@ .article_edit, .rss, .configuration_module { - display: none !important; + display: none; } .colMilieu, .colContenu { - width: 100% !important; - max-width: 100% !important; + width: 100% ; + max-width: 100% ; } .liste_vignette { - margin-bottom: 10px !important; + margin-bottom: 10px ; } .view_notice table .onglet { - display:none !important; + display:none ; } .notice_bloc_titre { - font-size: 1.1em !important; + font-size: 1.1em ; } a { - text-decoration: none !important; + text-decoration: none ; } \ No newline at end of file diff --git a/tests/application/modules/admin/controllers/BatchControllerTest.php b/tests/application/modules/admin/controllers/BatchControllerTest.php index c56604fb3585f24ab39f3dd14ace54eb44d5dac2..4159354c61347009a6ce81b875bd2f4823005fcd 100644 --- a/tests/application/modules/admin/controllers/BatchControllerTest.php +++ b/tests/application/modules/admin/controllers/BatchControllerTest.php @@ -76,12 +76,6 @@ class BatchControllerWithBatchInDb extends BatchControllerTestCase { public function batchActionShouldRunMyTask() { $this->assertXPath('//a[contains(@href, "batch/run")]'); } - - - /** @test */ - public function batchActionShouldRunAjaxMyTask() { - $this->assertXPath('//a[contains(@href, "batch/run-ajax")]'); - } } @@ -219,4 +213,26 @@ class BatchControllerRunMoissonnageVodeclicTest extends BatchControllerTestCase } + + +class BatchControllerRunAjaxAutocompleteTest extends BatchControllerTestCase { + public function setUp() { + parent::setUp(); + $this->fixture('Class_Batch', ['id' => 42, 'type' => 'AUTOCOMPLETE_RECORD_TITLE']); + $this->dispatch('/admin/batch', true); + } + + + /** @test */ + public function batchActionShouldRunAjaxMyTask() { + $this->assertXPath('//a[contains(@href, "batch/run-ajax/id/42")]'); + } + + + /** @test */ + public function batchActionShouldNotRunSimpleMyTask() { + $this->assertNotXPath('//a[contains(@href, "batch/run/id/42")]'); + } +} + ?> diff --git a/tests/application/modules/admin/controllers/CmsControllerTest.php b/tests/application/modules/admin/controllers/CmsControllerTest.php index 00f14be96b8f5c7aa7f99d98c00a0210bd035332..548f18a740b119aa4220660069cc9feeb1fb5018 100644 --- a/tests/application/modules/admin/controllers/CmsControllerTest.php +++ b/tests/application/modules/admin/controllers/CmsControllerTest.php @@ -134,13 +134,16 @@ abstract class CmsControllerTestCase extends Admin_AbstractControllerTestCase { public function setupArticles() { - $cat_a_la_une = Class_ArticleCategorie::newInstanceWithId(23, ['libelle' => 'A la Une']); + $cat_a_la_une = $this->fixture('Class_ArticleCategorie', + ['id' => 23, + 'libelle' => 'A la Une']); $this->annecy->setArticleCategories([$cat_a_la_une]); - $this->cat_evenements = Class_ArticleCategorie::newInstanceWithId(34, - ['libelle' => 'Evènements', - 'parent_categorie' => $cat_a_la_une, - 'sous_categories' => []]); + $this->cat_evenements = $this->fixture('Class_ArticleCategorie', + ['id' => 34, + 'libelle' => 'Evènements', + 'parent_categorie' => $cat_a_la_une, + 'sous_categories' => []]); $cat_a_la_une->setSousCategories([$this->cat_evenements]); @@ -1926,6 +1929,8 @@ class CmsControllerArticleNewTraductionPostTest extends CmsControllerTestCase { } + + class CmsControllerDeleteArticleTest extends CmsControllerTestCase { public function setUp() { parent::setUp(); @@ -1987,6 +1992,7 @@ class CmsControllerForceDeleteArticleTest extends CmsControllerTestCase { + class CmsControllerCategorieEvenementTest extends CmsControllerTestCase { /** @test */ @@ -2007,6 +2013,14 @@ class CmsControllerCategorieEvenementTest extends CmsControllerTestCase { } + /** @test */ + public function addCategorieCancelButtonShouldLinkToIndexIdCat34() { + $this->dispatch('/admin/cms/catadd/id/34'); + $this->assertXPath("//div[contains(@onclick, '/admin/cms/index/id_cat/34')]", + $this->_response->getBody()); + } + + /** @test */ function editCategorieShouldDisplayAllCat() { $this->dispatch('/admin/cms/catedit/id/34'); @@ -2016,16 +2030,22 @@ class CmsControllerCategorieEvenementTest extends CmsControllerTestCase { } + /** @test */ + public function editCategorieCancelButtonShouldLinkToIndexIdCat34() { + $this->dispatch('/admin/cms/catedit/id/34'); + $this->assertXPath("//div[contains(@onclick, '/admin/cms/index/id_cat/34')]", + $this->_response->getBody()); + } + + /** @test */ function postAddCategorieShouldRedirectWithIdCat() { - $this - ->getRequest() - ->setMethod('POST') - ->setPost(array('libelle' => 'concerts', - 'id_cat_mere' => 34)); - $this->dispatch('/admin/cms/catadd/id/34'); + $this->postDispatch('/admin/cms/catadd/id/34', + ['libelle' => 'concerts', + 'id_cat_mere' => 34]); - $this->assertEquals('/admin/cms/index/id_cat/34', $this->getResponseLocation()); + + $this->assertEquals('/admin/cms/index/id_cat/35', $this->getResponseLocation()); $new_cat = $this->categorie_wrapper->getFirstAttributeForLastCallOn('save'); $this->assertEquals('concerts', $new_cat->getLibelle()); @@ -2052,6 +2072,7 @@ class CmsControllerCategorieEvenementTest extends CmsControllerTestCase { + class CmsControllerCategorieNotFoundTest extends CmsControllerTestCase { /** @test */ function deleteShouldRedirectToAdminCms() { @@ -2118,8 +2139,10 @@ class CmsControllerNewsAddToCatALaUneInNewsModuleActionTest extends CmsControlle } } -class CmsControllerWithOptionPublicationDirecteWorkflowTest extends CmsControllerTestCase { + + +class CmsControllerWithOptionPublicationDirecteWorkflowTest extends CmsControllerTestCase { public function setup() { parent::setup(); Class_Users::beVolatile(); diff --git a/tests/application/modules/opac/controllers/NoticeAjaxControllerTest.php b/tests/application/modules/opac/controllers/NoticeAjaxControllerTest.php index 679692f442173b33dedb71e5867939a806531e79..b3fd37dbc4cf14dcb5d9a82f336bc6b3220c3147 100644 --- a/tests/application/modules/opac/controllers/NoticeAjaxControllerTest.php +++ b/tests/application/modules/opac/controllers/NoticeAjaxControllerTest.php @@ -411,10 +411,12 @@ class NoticeAjaxControllerExemplairesTest extends AbstractControllerTestCase { ZendAfi_Auth::getInstance()->clearIdentity(); - $this->_notice = Class_Notice::getLoader() - ->newInstanceWithId(123) + $this->_notice = Class_Notice::newInstanceWithId(123) ->beLivreNumerique() - ->setExemplaires(array()); + ->setExemplaires([]); + + + Class_Profil::getCurrentProfil()->setCfgNotice([]); $mock_sql = Storm_Test_ObjectWrapper::on(Zend_Registry::get('sql')); Zend_Registry::set('sql', $mock_sql); @@ -437,7 +439,7 @@ class NoticeAjaxControllerExemplairesTest extends AbstractControllerTestCase { false) ->answers($exemplaires); - $this->dispatch('noticeajax/exemplaires/id/123/id_notice/8'); + $this->dispatch('noticeajax/exemplaires/id/123/id_notice/8', true); } diff --git a/tests/application/modules/opac/controllers/ProfilOptionsControllerTest.php b/tests/application/modules/opac/controllers/ProfilOptionsControllerTest.php index 8b93e76b1f322444d2a6d690e9c29d003b4e2da6..662978190f8244acb02196cf202e4b4d2a7170ee 100644 --- a/tests/application/modules/opac/controllers/ProfilOptionsControllerTest.php +++ b/tests/application/modules/opac/controllers/ProfilOptionsControllerTest.php @@ -1204,7 +1204,7 @@ class ProfilOptionsControllerViewProfilJeunesseAccueilTest extends ProfilOptions /** @test */ function headerCssJeunesseShouldBeIncluded() { - $this->assertXPath('//link[@rel="stylesheet"][@type="text/css"][contains(@href, "afi-opac3/userfiles/jeunesse.css")]'); + $this->assertXPath('//link[@rel="stylesheet"][@media="all"][@type="text/css"][contains(@href, "afi-opac3/userfiles/jeunesse.css")]'); } diff --git a/tests/library/Class/Systeme/PergameServiceTest.php b/tests/library/Class/Systeme/PergameServiceTest.php index 3f94df2ffa12a98e648c77af3327b613597658ac..11d4bedc1d2f093657052185d46cbb8bebbecd83 100644 --- a/tests/library/Class/Systeme/PergameServiceTest.php +++ b/tests/library/Class/Systeme/PergameServiceTest.php @@ -264,7 +264,7 @@ extends PergameServiceReserverExemplaireValidUserTestCase { /** @test */ public function shouldReturnMaxHoldError() { - $this->assertPopupContains('nombre maximum de réservations'); + $this->assertEquals(['erreur' => 'La réservation est impossible car vous avez atteint le nombre maximum de réservations sur votre carte.'], $this->response); } } @@ -288,7 +288,7 @@ extends PergameServiceReserverExemplaireValidUserTestCase { /** @test */ public function shouldReturnMaxHoldError() { - $this->assertPopupContains('nombre maximum de réservations pour ce document'); + $this->assertEquals(['erreur' => 'La réservation est impossible car le nombre maximum de réservations pour ce document a été atteint (3).'], $this->response); } }