Skip to content
Snippets Groups Projects
Commit 88423999 authored by Ghislain Loas's avatar Ghislain Loas
Browse files

dev #69826 : wip cosmogramme phase

parent d6febc20
Branches
Tags
2 merge requests!2523Master,!2516Dev#69826 contractuel minsoc diffusion selective de l information enregistrer modifier ma recherche
Pipeline #3340 failed with stage
in 25 minutes and 17 seconds
......@@ -532,11 +532,24 @@ if ($phase==14 or $phase==15) {
$phase = 16;
}
// ----------------------------------------------------------------
// Indexation Domaines
// ----------------------------------------------------------------
if ($phase==16 or $phase==17) {
include("integration/domaines.php");
}
// ----------------------------------------------------------------
// DSI - Notifications des nouveautés
// ----------------------------------------------------------------
if ($phase==17 or $phase==18) {
startIntegrationPhase('BookmarkedSearches');
$phase=20;
}
// ----------------------------------------------------------------
// Envoi de mails aux bibs qui ont du retard
// ----------------------------------------------------------------
......
<?php
/**
* Copyright (c) 2012-2017, 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 Class_Cosmogramme_Integration_PhaseBookmarkedSearches extends Class_Cosmogramme_Integration_PhaseAbstract {
const MY_ID = 18;
public function __construct($phase, $log, $chrono) {
parent::__construct($phase, $log, $chrono);
$this->_label = $this->_('Notification des nouveautés dans les recherches favorites');
}
protected function _init($phase) {
$phase->resetDatas();
}
protected function _execute() {
if (!$this->_phase->isCron()) {
$this->_log->log($this->_('Ce traitement ne se lance qu\'en mode cron.'));
return;
}
}
}
......@@ -381,4 +381,43 @@ class Bookmarks_SearchAuthorizedActionTest extends Bookmarks_SearchWithSessionAb
$this->assertNotNull(Class_User_BookmarkedSearch::find(5));
$this->assertFlashMessengerContentContains('Vous n\'avez pas la permission');
}
}
class Bookmarks_SearchCosmogrammePhaseTest extends Class_Cosmogramme_Integration_PhaseTestCase {
protected $_result;
protected function _getPreviousPhase() {
return (new Class_Cosmogramme_Integration_Phase(17))
->beCron();
}
protected function _prepareFixtures() {
$criteres_potter = (new Class_CriteresRecherche)
->setParams(['expressionRecherche' => 'Harry Potter',
'page' => 2]);
$this->fixture('Class_User_BookmarkedSearch',
['id' => 5,
'criterias' => $criteres_potter,
'notified' => 1]);
}
public function setUp() {
parent::setUp();
$this->_phase = $this->_buildPhase('BookmarkedSearches')
->setMemoryCleaner(function() {})
->setPrinter($this->_printer);
$this->_result = $this->_phase->run();
}
/** @test */
public function fooShouldBar() {
$this->assertTrue(false);
}
}
\ No newline at end of file
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