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

fix flood from MigrationTest in test running

parent 0208f8c7
Branches
Tags
4 merge requests!278Master,!275Master,!274Master,!273Hotline 6.47
......@@ -21,6 +21,7 @@
class Class_Migration_ScriptPatchs {
use Trait_EchoError;
use Trait_Translator;
protected $force=false;
......@@ -32,23 +33,23 @@ class Class_Migration_ScriptPatchs {
}
public function visitPhpError($exception) {
echo("Code : ".$exception->getCode()."\n");
echo("Erreur :".$exception->getMessage());
$this->echoError("Code : ".$exception->getCode()."\n");
$this->echoError("Erreur :".$exception->getMessage());
}
public function visitHeader($patch_level) {
}
public function visitDisplayInstruction($instruction) {
echo($instruction."\n");
$this->echoError($instruction."\n");
}
public function visitSqlSkip($num_instruction) {
return false;
}
public function visitSqlException($e,$num_instruction) {
echo("Code : ".$e->getCode()."\n");
echo("Erreur :".$e->getMessage());
$this->echoError("Code : ".$e->getCode()."\n");
$this->echoError("Erreur :".$e->getMessage());
}
public function visitIsForceUpgrade() {
......@@ -56,12 +57,12 @@ class Class_Migration_ScriptPatchs {
}
public function visitDisplayDone() {
echo($this->_('Mise à niveau de la base effectuée avec succès'));
$this->echoError($this->_('Mise à niveau de la base effectuée avec succès'));
}
public function visitDisplayPatchLevel($num_patch) {
echo('Execution patch n° ' . $num_patch."\n");
$this->echoError('Execution patch n° ' . $num_patch."\n");
}
......
<?php
/**
* Copyright (c) 2012-2014, Agence Française Informatique (AFI). All rights reserved.
*
* AFI-OPAC 2.0 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).
*
* AFI-OPAC 2.0 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 AFI-OPAC 2.0; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
trait Trait_EchoError {
protected static $_echo;
public function echoError($error) {
return call_user_func(function($args) {
if(!self::$_echo)
echo $args;
return $args;
},$error);
}
public static function setEcho($echo) {
self::$_echo = $echo;
}
}
?>
\ No newline at end of file
......@@ -24,6 +24,9 @@ abstract class MigrationTestCase extends Storm_Test_ModelTestCase {
public function setUp() {
parent::setUp();
Class_Migration_ScriptPatchs::setEcho('none');
$this->fixture('Class_CosmoVar', ['id' => 'patch_level',
'valeur' => 10 ] );
$this->_old_sql = Zend_Registry::get('sql');
......
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