diff --git a/VERSIONS_HOTLINE/214576 b/VERSIONS_HOTLINE/214576 new file mode 100644 index 0000000000000000000000000000000000000000..c7a9343d987beb653499ce7184d46850059765e0 --- /dev/null +++ b/VERSIONS_HOTLINE/214576 @@ -0,0 +1 @@ + - correctif #214576 : recherches favorites: Les notifications par mail des recherches favorites sont à nouveau actives \ No newline at end of file diff --git a/cosmogramme/php/integre_traite_main.php b/cosmogramme/php/integre_traite_main.php index 8b3a28b0904898e3620e39e2671c52e28eb97056..154b7bd061c6303f7391012173f537c4755f0864 100644 --- a/cosmogramme/php/integre_traite_main.php +++ b/cosmogramme/php/integre_traite_main.php @@ -315,7 +315,7 @@ if (12 == $phase || 13 == $phase) { // ---------------------------------------------------------------- // DSI - Notifications des nouveautés // ---------------------------------------------------------------- -if ($phase >= 14 || $phase <= 19) { +if (14 == $phase) { startIntegrationPhase('BookmarkedSearches'); $phase = 20; } diff --git a/library/Class/Cosmogramme/Integration/PhaseBookmarkedSearches.php b/library/Class/Cosmogramme/Integration/PhaseBookmarkedSearches.php index 99c84e80ac9d20edca705caf673e59edcecde089..5a416f83b8330e435c8c0e89776f6e73bffbe74b 100644 --- a/library/Class/Cosmogramme/Integration/PhaseBookmarkedSearches.php +++ b/library/Class/Cosmogramme/Integration/PhaseBookmarkedSearches.php @@ -31,6 +31,12 @@ class Class_Cosmogramme_Integration_PhaseBookmarkedSearches } + protected function _previousPhaseIds() + { + return [14]; + } + + protected function _init($phase) { $phase->resetDatas(); } diff --git a/tests/library/Class/Cosmogramme/Integration/PhaseBookmarkedSearchesTest.php b/tests/library/Class/Cosmogramme/Integration/PhaseBookmarkedSearchesTest.php new file mode 100644 index 0000000000000000000000000000000000000000..189e2e793ab5eb8f3f855892a413395263e84b53 --- /dev/null +++ b/tests/library/Class/Cosmogramme/Integration/PhaseBookmarkedSearchesTest.php @@ -0,0 +1,56 @@ +<?php +/** + * Copyright (c) 2012-2021, 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 + */ + + +class PhaseBookmarkedSearchesTest + extends Class_Cosmogramme_Integration_PhaseTestCase +{ + protected function _getPreviousPhase() + { + return (new Class_Cosmogramme_Integration_Phase(14))->beCron(); + } + + + public function setUp(): void + { + parent::setUp(); + Zend_Registry::set('sql', + $this->mock() + ->whenCalled('query') + ->with('ALTER TABLE `notices` ADD FULLTEXT KEY IF NOT EXISTS `mots_notice` (`titres`, `auteurs`, `editeur`, `collection`, `matieres`, `dewey`, `other_terms`, `facets`)') + ->answers([])); + + $this->_phase = $this->_buildPhase('BookmarkedSearches')->run(); + } + + public function tearDown(): void + { + Zend_Registry::set('sql',null); + parent::tearDown(); + } + + + /** @test */ + public function logShouldContainsNotificationNouveautes() + { + $this->assertLogContains('Notification des nouveautés dans les recherches favorites'); + } +} diff --git a/tests/scenarios/bookmarks/SearchTest.php b/tests/scenarios/bookmarks/SearchTest.php index 8fa982edd9d256cbef59cb60aaac9aef56d4a91d..17b2741fe36ca296110b3c2306a61333cac530b3 100644 --- a/tests/scenarios/bookmarks/SearchTest.php +++ b/tests/scenarios/bookmarks/SearchTest.php @@ -454,7 +454,7 @@ class Bookmarks_SearchCosmogrammePhaseTest $_mail_transport; protected function _getPreviousPhase() { - return (new Class_Cosmogramme_Integration_Phase(17)) + return (new Class_Cosmogramme_Integration_Phase(14)) ->beCron(); } @@ -626,7 +626,7 @@ class Bookmarks_SearchMailWithArticlePhaseTest $_mail; protected function _getPreviousPhase() { - return (new Class_Cosmogramme_Integration_Phase(17)) + return (new Class_Cosmogramme_Integration_Phase(14)) ->beCron(); }