Qual: More phpunit tests

This commit is contained in:
Laurent Destailleur 2010-10-23 17:03:08 +00:00
parent 00cc81b688
commit c6e8b813f4
4 changed files with 83 additions and 10 deletions

View File

@ -138,12 +138,12 @@ class ModeleNumRefFicheinter
/**
\brief Cree une fiche intervention sur disque en fonction du modele de FICHEINTER_ADDON_PDF
\param db objet base de donnee
\param object Object fichinter
\param modele force le modele a utiliser ('' par defaut)
\param outputlangs objet lang a utiliser pour traduction
\return int 0 si KO, 1 si OK
* Create an intervention document on disk using template defined into FICHEINTER_ADDON_PDF
* @param db objet base de donnee
* @param object Object fichinter
* @param modele force le modele a utiliser ('' par defaut)
* @param outputlangs objet lang a utiliser pour traduction
* @return int 0 si KO, 1 si OK
*/
function fichinter_create($db, $object, $modele='', $outputlangs='')
{
@ -161,9 +161,10 @@ function fichinter_create($db, $object, $modele='', $outputlangs='')
}
else
{
dol_syslog("Error ".$langs->trans("Error_FICHEINTER_ADDON_PDF_NotDefined"), LOG_ERR);
print "Error ".$langs->trans("Error_FICHEINTER_ADDON_PDF_NotDefined");
return 0;
$modele = 'soleil';
//dol_syslog("Error ".$langs->trans("Error_FICHEINTER_ADDON_PDF_NotDefined"), LOG_ERR);
//print "Error ".$langs->trans("Error_FICHEINTER_ADDON_PDF_NotDefined");
//return 0;
}
}

View File

@ -33,6 +33,8 @@ require_once dirname(__FILE__).'/../../htdocs/commande/class/commande.class.php'
require_once dirname(__FILE__).'/../../htdocs/comm/propal/class/propal.class.php';
require_once dirname(__FILE__).'/../../htdocs/fichinter/class/fichinter.class.php';
require_once dirname(__FILE__).'/../../htdocs/expedition/class/expedition.class.php';
require_once dirname(__FILE__).'/../../htdocs/projet/class/project.class.php';
require_once dirname(__FILE__).'/../../htdocs/projet/class/task.class.php';
if (empty($user->id))
{
@ -223,6 +225,34 @@ class BuildDocTest extends PHPUnit_Framework_TestCase
return 0;
}
/**
* @covers ModelePDFProjects
* @covers pdf_baleine
*/
public function testProjectBuild()
{
global $conf,$user,$langs,$db;
$conf=$this->savconf;
$user=$this->savuser;
$langs=$this->savlangs;
$db=$this->savdb;
require_once(DOL_DOCUMENT_ROOT.'/includes/modules/project/modules_project.php');
$conf->project->dir_output.='/temp';
$localobject=new Project($this->savdb);
$localobject->initAsSpecimen();
$localobject->socid=1;
// Soleil
$localobject->modelpdf='baleine';
$result=project_pdf_create($db, $localobject, $localobject->modelpdf, $langs);
$this->assertLessThan($result, 0);
print __METHOD__." result=".$result."\n";
return 0;
}
/**
* @covers ModelePDFFicheinter
* @covers pdf_soleil

View File

@ -49,6 +49,49 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1;
* @covers modBarcode
* @covers modBookmark
* @covers modBoutique
* @covers modCashDesk
* @covers modCategorie
* @covers modClickToDial
* @covers modCommande
* @covers modComptabilite
* @covers modContrat
* @covers modDeplacement
* @covers modDocument
* @covers modDomain
* @covers modDon
* @covers modECM
* @covers modExpedition
* @covers modExport
* @covers modExternalRss
* @covers modExternalSite
* @covers modFacture
* @covers modFckeditor
* @covers modFicheinter
* @covers modFournisseur
* @covers modFTP
* @covers modGeoIPMaxmind
* @covers modGravatar
* @covers modImport
* @covers modLabel
* @covers modLdap
* @covers modMailing
* @covers modMantis
* @covers modNotification
* @covers modPaybox
* @covers modPaypal
* @covers modPhenix
* @covers modPrelevement
* @covers modProduct
* @covers modProjet
* @covers modPropale
* @covers modService
* @covers modSociete
* @covers modStock
* @covers modSyslog
* @covers modTax
* @covers modUser
* @covers modWebcalendar
* @covers modWebServices
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
*/
class ModulesTest extends PHPUnit_Framework_TestCase

View File

@ -11,7 +11,6 @@
<directory>../../htdocs/includes/fpdf/</directory>
<directory>../../htdocs/includes/geoip/</directory>
<directory>../../htdocs/includes/iui/</directory>
<directory>../../htdocs/includes/iwebkit/</directory>
<directory>../../htdocs/includes/jcrop/</directory>
<directory>../../htdocs/includes/jquery/</directory>
<directory>../../htdocs/includes/jsgantt/</directory>