forked from Wavyzz/dolibarr
Mutualise code
This commit is contained in:
@@ -29,6 +29,7 @@ global $conf,$user,$langs,$db;
|
||||
//require_once 'PHPUnit/Autoload.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/accountancy/class/accountingaccount.class.php';
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
if (empty($user->id)) {
|
||||
print "Load permissions for admin user nb 1\n";
|
||||
@@ -45,7 +46,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1;
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class AccountingAccountTest extends PHPUnit\Framework\TestCase
|
||||
class AccountingAccountTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
@@ -93,45 +94,6 @@ class AccountingAccountTest extends PHPUnit\Framework\TestCase
|
||||
print __METHOD__."\n";
|
||||
}
|
||||
|
||||
/**
|
||||
* tearDownAfterClass
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function tearDownAfterClass(): void
|
||||
{
|
||||
global $conf,$user,$langs,$db;
|
||||
$db->rollback();
|
||||
|
||||
print __METHOD__."\n";
|
||||
}
|
||||
|
||||
/**
|
||||
* Init phpunit tests
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function setUp(): void
|
||||
{
|
||||
global $conf,$user,$langs,$db;
|
||||
$conf=$this->savconf;
|
||||
$user=$this->savuser;
|
||||
$langs=$this->savlangs;
|
||||
$db=$this->savdb;
|
||||
|
||||
print __METHOD__."\n";
|
||||
//print $db->getVersion()."\n";
|
||||
}
|
||||
|
||||
/**
|
||||
* End phpunit tests
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function tearDown(): void
|
||||
{
|
||||
print __METHOD__."\n";
|
||||
}
|
||||
|
||||
/**
|
||||
* testAccountingAccountCreate
|
||||
|
||||
@@ -29,6 +29,7 @@ global $conf,$user,$langs,$db;
|
||||
//require_once 'PHPUnit/Autoload.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/comm/action/class/actioncomm.class.php';
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
if (empty($user->id)) {
|
||||
print "Load permissions for admin user nb 1\n";
|
||||
@@ -45,7 +46,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1;
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class ActionCommTest extends PHPUnit\Framework\TestCase
|
||||
class ActionCommTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -31,6 +31,7 @@ global $conf,$user,$langs,$db;
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/adherents/class/adherent.class.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/adherents/class/adherent_type.class.php';
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
if (empty($user->id)) {
|
||||
print "Load permissions for admin user nb 1\n";
|
||||
@@ -47,7 +48,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1;
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class AdherentTest extends PHPUnit\Framework\TestCase
|
||||
class AdherentTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -29,6 +29,7 @@ global $conf,$user,$langs,$db;
|
||||
//require_once 'PHPUnit/Autoload.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/core/lib/admin.lib.php';
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
if (empty($user->id)) {
|
||||
print "Load permissions for admin user nb 1\n";
|
||||
@@ -45,7 +46,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1;
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class AdminLibTest extends PHPUnit\Framework\TestCase
|
||||
class AdminLibTest extends CommonClassTest
|
||||
{
|
||||
protected $backupGlobalsBlacklist = array('conf', 'user', 'langs', 'db');
|
||||
protected $savconf;
|
||||
|
||||
@@ -29,6 +29,7 @@ global $conf, $user, $langs, $db;
|
||||
//require_once 'PHPUnit/Autoload.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/asset/class/assetmodel.class.php';
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
if (empty($user->id)) {
|
||||
print "Load permissions for admin user nb 1\n";
|
||||
@@ -47,7 +48,7 @@ $langs->load("main");
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class AssetModelTest extends PHPUnit\Framework\TestCase
|
||||
class AssetModelTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -28,6 +28,7 @@ global $conf,$user,$langs,$db;
|
||||
//require_once 'PHPUnit/Autoload.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/bom/class/bom.class.php';
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
if (empty($user->id)) {
|
||||
print "Load permissions for admin user nb 1\n";
|
||||
@@ -46,7 +47,7 @@ $langs->load("main");
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class BOMTest extends PHPUnit\Framework\TestCase
|
||||
class BOMTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -30,6 +30,7 @@ global $conf,$user,$langs,$db;
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/compta/bank/class/account.class.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/core/lib/bank.lib.php';
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
if (empty($user->id)) {
|
||||
print "Load permissions for admin user nb 1\n";
|
||||
@@ -48,7 +49,7 @@ $langs->load("main");
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class BankAccountTest extends PHPUnit\Framework\TestCase
|
||||
class BankAccountTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -29,7 +29,7 @@ global $conf,$user,$langs,$db;
|
||||
//require_once 'PHPUnit/Autoload.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/compta/facture/class/facture.class.php';
|
||||
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
if (empty($user->id)) {
|
||||
print "Load permissions for admin user nb 1\n";
|
||||
@@ -48,7 +48,7 @@ $langs->load("main");
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class BarcodeTest extends PHPUnit\Framework\TestCase
|
||||
class BarcodeTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -29,6 +29,7 @@ global $conf,$user,$langs,$db;
|
||||
//require_once 'PHPUnit/Autoload.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/compta/prelevement/class/bonprelevement.class.php';
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
if (empty($user->id)) {
|
||||
print "Load permissions for admin user nb 1\n";
|
||||
@@ -47,7 +48,7 @@ $langs->load("main");
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class BonPrelevementTest extends PHPUnit\Framework\TestCase
|
||||
class BonPrelevementTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -57,8 +57,8 @@ require_once dirname(__FILE__).'/../../htdocs/core/modules/propale/modules_propa
|
||||
require_once dirname(__FILE__).'/../../htdocs/core/modules/project/modules_project.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/core/modules/fichinter/modules_fichinter.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/core/modules/expedition/modules_expedition.php';
|
||||
|
||||
require_once dirname(__FILE__).'/../../htdocs/core/modules/modExpenseReport.class.php';
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
|
||||
if (empty($user->id)) {
|
||||
@@ -76,7 +76,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1;
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class BuildDocTest extends PHPUnit\Framework\TestCase
|
||||
class BuildDocTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -30,6 +30,7 @@ global $conf, $user, $langs, $db;
|
||||
require_once dirname(__FILE__) . '/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__) . '/../../htdocs/core/class/CMailFile.class.php';
|
||||
require_once dirname(__FILE__) . '/../../htdocs/core/lib/files.lib.php';
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
if (empty($user->id)) {
|
||||
print "Load permissions for admin user nb 1\n";
|
||||
@@ -46,7 +47,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS = 1;
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class CMailFileTest extends PHPUnit\Framework\TestCase
|
||||
class CMailFileTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -30,6 +30,7 @@ global $conf,$user,$langs,$db;
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/categories/class/categorie.class.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/product/class/product.class.php';
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
if (empty($user->id)) {
|
||||
print "Load permissions for admin user nb 1\n";
|
||||
@@ -46,7 +47,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1;
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class CategorieTest extends PHPUnit\Framework\TestCase
|
||||
class CategorieTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -29,6 +29,7 @@ global $conf,$user,$langs,$db;
|
||||
//require_once 'PHPUnit/Autoload.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/compta/sociales/class/chargesociales.class.php';
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
if (empty($user->id)) {
|
||||
print "Load permissions for admin user nb 1\n";
|
||||
@@ -45,7 +46,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1;
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class ChargeSocialesTest extends PHPUnit\Framework\TestCase
|
||||
class ChargeSocialesTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -30,6 +30,7 @@ global $conf,$user,$langs,$db;
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/core/lib/security.lib.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/core/lib/security2.lib.php';
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
if (! defined('NOREQUIREUSER')) {
|
||||
define('NOREQUIREUSER', '1');
|
||||
@@ -77,7 +78,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1;
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class CodingPhpTest extends PHPUnit\Framework\TestCase
|
||||
class CodingPhpTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -30,6 +30,7 @@ global $conf,$user,$langs,$db;
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/core/lib/security.lib.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/core/lib/security2.lib.php';
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
if (! defined('NOREQUIREUSER')) {
|
||||
define('NOREQUIREUSER', '1');
|
||||
@@ -77,7 +78,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1;
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class CodingSqlTest extends PHPUnit\Framework\TestCase
|
||||
class CodingSqlTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -30,6 +30,7 @@ global $conf,$user,$langs,$db;
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/fourn/class/fournisseur.commande.class.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/fourn/class/fournisseur.product.class.php';
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
if (empty($user->id)) {
|
||||
print "Load permissions for admin user nb 1\n";
|
||||
@@ -47,7 +48,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1;
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class CommandeFournisseurTest extends PHPUnit\Framework\TestCase
|
||||
class CommandeFournisseurTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -29,6 +29,7 @@ global $conf,$user,$langs,$db;
|
||||
//require_once 'PHPUnit/Autoload.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/commande/class/commande.class.php';
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
if (empty($user->id)) {
|
||||
print "Load permissions for admin user nb 1\n";
|
||||
@@ -45,7 +46,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1;
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class CommandeTest extends PHPUnit\Framework\TestCase
|
||||
class CommandeTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
163
test/phpunit/CommonClassTest.class.php
Normal file
163
test/phpunit/CommonClassTest.class.php
Normal file
@@ -0,0 +1,163 @@
|
||||
<?php
|
||||
/* Copyright (C) 2018 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2023 Alexandre Janniaux <alexandre.janniaux@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
* or see https://www.gnu.org/
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file test/phpunit/ActionCommTest.php
|
||||
* \ingroup test
|
||||
* \brief PHPUnit test
|
||||
* \remarks To run this script as CLI: phpunit filename.php
|
||||
*/
|
||||
|
||||
global $conf,$user,$langs,$db;
|
||||
//define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver
|
||||
//require_once 'PHPUnit/Autoload.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
|
||||
if (empty($user->id)) {
|
||||
print "Load permissions for admin user nb 1\n";
|
||||
$user->fetch(1);
|
||||
$user->getrights();
|
||||
}
|
||||
$conf->global->MAIN_DISABLE_ALL_MAILS=1;
|
||||
|
||||
|
||||
/**
|
||||
* Class for PHPUnit tests
|
||||
*
|
||||
* @backupGlobals disabled
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class CommonClassTest extends PHPUnit\Framework\TestCase
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
protected $savlangs;
|
||||
protected $savdb;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* We save global variables into local variables
|
||||
*
|
||||
* @param string $name Name
|
||||
* @return ActionCommTest
|
||||
*/
|
||||
public function __construct($name = '')
|
||||
{
|
||||
parent::__construct($name);
|
||||
|
||||
//$this->sharedFixture
|
||||
global $conf,$user,$langs,$db;
|
||||
$this->savconf=$conf;
|
||||
$this->savuser=$user;
|
||||
$this->savlangs=$langs;
|
||||
$this->savdb=$db;
|
||||
|
||||
print __METHOD__." db->type=".$db->type." user->id=".$user->id;
|
||||
//print " - db ".$db->db;
|
||||
print "\n";
|
||||
}
|
||||
|
||||
/**
|
||||
* setUpBeforeClass
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function setUpBeforeClass(): void
|
||||
{
|
||||
global $conf,$user,$langs,$db;
|
||||
$db->begin(); // This is to have all actions inside a transaction even if test launched without suite.
|
||||
|
||||
if (!isModEnabled('agenda')) {
|
||||
print __METHOD__." module agenda must be enabled.\n";
|
||||
die(1);
|
||||
}
|
||||
|
||||
print __METHOD__."\n";
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is called when a test fails
|
||||
*
|
||||
* @param Throwable $t Throwable object
|
||||
* @return void
|
||||
*/
|
||||
protected function onNotSuccessfulTest(Throwable $t): void
|
||||
{
|
||||
$logfile = DOL_DATA_ROOT.'/dolibarr.log';
|
||||
|
||||
$lines = file($logfile);
|
||||
|
||||
$nbLinesToShow = 100;
|
||||
$totalLines = count($lines);
|
||||
$premiereLigne = max(0, $totalLines - $nbLinesToShow);
|
||||
|
||||
// Obtient les dernières lignes du tableau
|
||||
$dernieresLignes = array_slice($lines, $premiereLigne, $nbLinesToShow);
|
||||
|
||||
// Show log file
|
||||
print "\n----- Test fails. Show last ".$nbLinesToShow." lines of dolibarr.log file -----\n";
|
||||
foreach ($dernieresLignes as $ligne) {
|
||||
print $ligne . "<br>";
|
||||
}
|
||||
|
||||
parent::onNotSuccessfulTest($t);
|
||||
}
|
||||
|
||||
/**
|
||||
* Init phpunit tests
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function setUp(): void
|
||||
{
|
||||
global $conf,$user,$langs,$db;
|
||||
|
||||
$conf=$this->savconf;
|
||||
$user=$this->savuser;
|
||||
$langs=$this->savlangs;
|
||||
$db=$this->savdb;
|
||||
|
||||
print __METHOD__."\n";
|
||||
//print $db->getVersion()."\n";
|
||||
}
|
||||
|
||||
/**
|
||||
* End phpunit tests
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function tearDown(): void
|
||||
{
|
||||
print __METHOD__."\n";
|
||||
}
|
||||
|
||||
/**
|
||||
* tearDownAfterClass
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function tearDownAfterClass(): void
|
||||
{
|
||||
global $db;
|
||||
$db->rollback();
|
||||
|
||||
print __METHOD__."\n";
|
||||
}
|
||||
}
|
||||
@@ -29,6 +29,7 @@ global $conf,$user,$langs,$db;
|
||||
//require_once 'PHPUnit/Autoload.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/compta/facture/class/facture.class.php';
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
if (empty($user->id)) {
|
||||
print "Load permissions for admin user nb 1\n";
|
||||
@@ -45,7 +46,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1;
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class CommonInvoiceTest extends PHPUnit\Framework\TestCase
|
||||
class CommonInvoiceTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -30,6 +30,7 @@ global $conf,$user,$langs,$db;
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/commande/class/commande.class.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/projet/class/project.class.php';
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
if (empty($user->id)) {
|
||||
print "Load permissions for admin user nb 1\n";
|
||||
@@ -46,7 +47,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1;
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class CommonObjectTest extends PHPUnit\Framework\TestCase
|
||||
class CommonObjectTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -29,6 +29,7 @@ global $conf,$user,$langs,$db;
|
||||
//require_once 'PHPUnit/Autoload.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/societe/class/companybankaccount.class.php';
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
if (empty($user->id)) {
|
||||
print "Load permissions for admin user nb 1\n";
|
||||
@@ -45,7 +46,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1;
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class CompanyBankAccountTest extends PHPUnit\Framework\TestCase
|
||||
class CompanyBankAccountTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -29,6 +29,7 @@ global $conf,$user,$langs,$db;
|
||||
//require_once 'PHPUnit/Autoload.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/core/lib/company.lib.php';
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
if (empty($user->id)) {
|
||||
print "Load permissions for admin user nb 1\n";
|
||||
@@ -45,7 +46,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1;
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class CompanyLibTest extends PHPUnit\Framework\TestCase
|
||||
class CompanyLibTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -29,6 +29,8 @@ global $conf,$user,$langs,$db;
|
||||
//require_once 'PHPUnit/Autoload.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/contact/class/contact.class.php';
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
$langs->load("dict");
|
||||
|
||||
if ($langs->defaultlang != 'en_US') {
|
||||
@@ -52,7 +54,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1;
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class ContactTest extends PHPUnit\Framework\TestCase
|
||||
class ContactTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -29,6 +29,7 @@ global $conf,$user,$langs,$db;
|
||||
//require_once 'PHPUnit/Autoload.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/contrat/class/contrat.class.php';
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
if (empty($user->id)) {
|
||||
print "Load permissions for admin user nb 1\n";
|
||||
@@ -45,7 +46,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1;
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class ContratTest extends PHPUnit\Framework\TestCase
|
||||
class ContratTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -29,6 +29,9 @@ global $conf,$user,$langs,$db;
|
||||
//require_once 'PHPUnit/Autoload.php';
|
||||
//require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
|
||||
if (! defined('NOREQUIREUSER')) {
|
||||
define('NOREQUIREUSER', '1');
|
||||
}
|
||||
@@ -68,7 +71,7 @@ if (! defined("NOLOGIN")) {
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class CoreTest extends PHPUnit\Framework\TestCase
|
||||
class CoreTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -29,6 +29,7 @@ global $conf,$user,$langs,$db;
|
||||
//require_once 'PHPUnit/Autoload.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/core/lib/date.lib.php';
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
if (empty($user->id)) {
|
||||
print "Load permissions for admin user nb 1\n";
|
||||
@@ -49,7 +50,7 @@ print "\n";
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class DateLibTest extends PHPUnit\Framework\TestCase
|
||||
class DateLibTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -29,6 +29,7 @@ global $conf,$user,$langs,$db;
|
||||
//require_once 'PHPUnit/Autoload.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/core/lib/date.lib.php';
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
if (empty($user->id)) {
|
||||
print "Load permissions for admin user nb 1\n";
|
||||
@@ -45,7 +46,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1;
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class DateLibTzFranceTest extends PHPUnit\Framework\TestCase
|
||||
class DateLibTzFranceTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -29,6 +29,7 @@ global $conf,$user,$langs,$db;
|
||||
//require_once 'PHPUnit/Autoload.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/core/class/discount.class.php';
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
if (empty($user->id)) {
|
||||
print "Load permissions for admin user nb 1\n";
|
||||
@@ -45,7 +46,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1;
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class DiscountTest extends PHPUnit\Framework\TestCase
|
||||
class DiscountTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -29,6 +29,7 @@ global $conf,$user,$langs,$db;
|
||||
//require_once 'PHPUnit/Autoload.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/core/class/discount.class.php';
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
if (empty($user->id)) {
|
||||
print "Load permissions for admin user nb 1\n";
|
||||
@@ -45,7 +46,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1;
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class DoliDBTest extends PHPUnit\Framework\TestCase
|
||||
class DoliDBTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -29,6 +29,7 @@ global $conf,$user,$langs,$db;
|
||||
//require_once 'PHPUnit/Autoload.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/emailcollector/class/emailcollector.class.php';
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
if (empty($user->id)) {
|
||||
print "Load permissions for admin user nb 1\n";
|
||||
@@ -47,7 +48,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1;
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class EmailCollectorTest extends PHPUnit\Framework\TestCase
|
||||
class EmailCollectorTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -29,6 +29,7 @@ global $conf,$user,$langs,$db;
|
||||
//require_once 'PHPUnit/Autoload.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/product/stock/class/entrepot.class.php';
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
if (empty($user->id)) {
|
||||
print "Load permissions for admin user nb 1\n";
|
||||
@@ -45,7 +46,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1;
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class EntrepotTest extends PHPUnit\Framework\TestCase
|
||||
class EntrepotTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
global $conf,$user,$langs,$db;
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/core/class/evalmath.class.php';
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
if (empty($user->id)) {
|
||||
print "Load permissions for admin user nb 1\n";
|
||||
@@ -44,7 +45,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1;
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class EvalMathTest extends PHPUnit\Framework\TestCase
|
||||
class EvalMathTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -29,6 +29,7 @@ global $conf,$user,$langs,$db;
|
||||
//require_once 'PHPUnit/Autoload.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/expensereport/class/expensereport.class.php';
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
if (empty($user->id)) {
|
||||
print "Load permissions for admin user nb 1\n";
|
||||
@@ -46,7 +47,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1;
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class ExpenseReportTest extends PHPUnit\Framework\TestCase
|
||||
class ExpenseReportTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -30,6 +30,7 @@ global $conf,$user,$langs,$db;
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/exports/class/export.class.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/core/lib/files.lib.php';
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
if (! defined('NOREQUIREUSER')) {
|
||||
define('NOREQUIREUSER', '1');
|
||||
@@ -70,7 +71,7 @@ if (! defined("NOLOGIN")) {
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class ExportTest extends PHPUnit\Framework\TestCase
|
||||
class ExportTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -30,6 +30,7 @@ global $conf,$user,$langs,$db;
|
||||
//require_once 'PHPUnit/Autoload.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/fourn/class/fournisseur.facture.class.php';
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
if (empty($user->id)) {
|
||||
print "Load permissions for admin user nb 1\n";
|
||||
@@ -46,7 +47,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1;
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class FactureFournisseurTest extends PHPUnit\Framework\TestCase
|
||||
class FactureFournisseurTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -30,6 +30,7 @@ global $conf,$user,$langs,$db;
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/compta/facture/class/facture.class.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/compta/facture/class/facture-rec.class.php';
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
if (empty($user->id)) {
|
||||
print "Load permissions for admin user nb 1\n";
|
||||
@@ -46,7 +47,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1;
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class FactureRecTest extends PHPUnit\Framework\TestCase
|
||||
class FactureRecTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -30,6 +30,7 @@ global $conf,$user,$langs,$db;
|
||||
//require_once 'PHPUnit/Autoload.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/compta/facture/class/facture.class.php';
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
if (empty($user->id)) {
|
||||
print "Load permissions for admin user nb 1\n";
|
||||
@@ -46,7 +47,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1;
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class FactureTest extends PHPUnit\Framework\TestCase
|
||||
class FactureTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -28,6 +28,7 @@ global $conf,$user,$langs,$db;
|
||||
//require_once 'PHPUnit/Autoload.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/compta/facture/class/facture.class.php';
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
if (empty($user->id)) {
|
||||
print "Load permissions for admin user nb 1\n";
|
||||
@@ -44,7 +45,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1;
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class FactureTestRounding extends PHPUnit\Framework\TestCase
|
||||
class FactureTestRounding extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -29,6 +29,7 @@ global $conf,$user,$langs,$db;
|
||||
//require_once 'PHPUnit/Autoload.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/fichinter/class/fichinter.class.php';
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
if (empty($user->id)) {
|
||||
print "Load permissions for admin user nb 1\n";
|
||||
@@ -45,7 +46,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1;
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class FichinterTest extends PHPUnit\Framework\TestCase
|
||||
class FichinterTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -31,6 +31,7 @@ global $conf,$user,$langs,$db;
|
||||
//require_once 'PHPUnit/Autoload.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/core/lib/files.lib.php';
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
if (empty($user->id)) {
|
||||
print "Load permissions for admin user nb 1\n";
|
||||
@@ -47,7 +48,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS = 1;
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class FilesLibTest extends PHPUnit\Framework\TestCase
|
||||
class FilesLibTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -29,6 +29,7 @@ global $conf,$user,$langs,$db;
|
||||
//require_once 'PHPUnit/Autoload.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/core/class/html.formadmin.class.php';
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
if (empty($user->id)) {
|
||||
print "Load permissions for admin user nb 1\n";
|
||||
@@ -45,7 +46,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1;
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class FormAdminTest extends PHPUnit\Framework\TestCase
|
||||
class FormAdminTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -29,6 +29,7 @@ global $conf,$user,$langs,$db;
|
||||
//require_once 'PHPUnit/Autoload.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/core/class/html.form.class.php';
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
if (empty($user->id)) {
|
||||
print "Load permissions for admin user nb 1\n";
|
||||
@@ -45,7 +46,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1;
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class FormTest extends PHPUnit\Framework\TestCase
|
||||
class FormTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -29,6 +29,7 @@ global $conf,$user,$langs,$db;
|
||||
//require_once 'PHPUnit/Autoload.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/core/lib/functions2.lib.php';
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
if (! defined('NOREQUIREUSER')) {
|
||||
define('NOREQUIREUSER', '1');
|
||||
@@ -69,7 +70,7 @@ if (! defined("NOLOGIN")) {
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class Functions2LibTest extends PHPUnit\Framework\TestCase
|
||||
class Functions2LibTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -31,6 +31,7 @@ global $conf,$user,$langs,$db,$mysoc;
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/core/lib/date.lib.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/product/class/product.class.php';
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
if (! defined('NOREQUIREUSER')) {
|
||||
define('NOREQUIREUSER', '1');
|
||||
@@ -75,7 +76,7 @@ print "\n";
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class FunctionsLibTest extends PHPUnit\Framework\TestCase
|
||||
class FunctionsLibTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -30,6 +30,7 @@ global $conf,$user,$langs,$db;
|
||||
//require_once 'PHPUnit/Autoload.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/core/lib/geturl.lib.php';
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
if (empty($user->id)) {
|
||||
print "Load permissions for admin user nb 1\n";
|
||||
@@ -46,7 +47,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1;
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class GetUrlLibTest extends PHPUnit\Framework\TestCase
|
||||
class GetUrlLibTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -29,6 +29,8 @@ global $conf,$user,$langs,$db;
|
||||
//require_once 'PHPUnit/Autoload.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/holiday/class/holiday.class.php';
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
$langs->load("dict");
|
||||
|
||||
if (empty($user->id)) {
|
||||
@@ -47,7 +49,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS = 1;
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class HolidayTest extends PHPUnit\Framework\TestCase
|
||||
class HolidayTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -31,6 +31,7 @@ global $conf,$user,$langs,$db;
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/core/lib/images.lib.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/core/lib/files.lib.php';
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
if (empty($user->id)) {
|
||||
print "Load permissions for admin user nb 1\n";
|
||||
@@ -47,7 +48,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1;
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class ImagesLibTest extends PHPUnit\Framework\TestCase
|
||||
class ImagesLibTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -28,6 +28,7 @@ global $conf,$user,$langs,$db;
|
||||
//define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver
|
||||
//require_once 'PHPUnit/Autoload.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
if (! defined('NOREQUIREUSER')) {
|
||||
define('NOREQUIREUSER', '1');
|
||||
@@ -68,7 +69,7 @@ if (! defined("NOLOGIN")) {
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class ImportTest extends PHPUnit\Framework\TestCase
|
||||
class ImportTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -30,6 +30,7 @@ global $conf,$user,$langs,$db;
|
||||
//require_once 'PHPUnit/Autoload.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/product/inventory/class/inventory.class.php';
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
if (empty($user->id)) {
|
||||
print "Load permissions for admin user nb 1\n";
|
||||
@@ -46,7 +47,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1;
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class InventoryTest extends PHPUnit\Framework\TestCase
|
||||
class InventoryTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -28,6 +28,7 @@ global $conf,$user,$langs,$db;
|
||||
//define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver
|
||||
//require_once 'PHPUnit/Autoload.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
if (! defined('NOREQUIREUSER')) {
|
||||
define('NOREQUIREUSER', '1');
|
||||
@@ -68,7 +69,7 @@ if (! defined("NOLOGIN")) {
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class JsonLibTest extends PHPUnit\Framework\TestCase
|
||||
class JsonLibTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -28,6 +28,8 @@ global $conf, $user, $langs, $db;
|
||||
//require_once 'PHPUnit/Autoload.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/knowledgemanagement/class/knowledgerecord.class.php';
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
$langs->load("main");
|
||||
|
||||
if (empty($user->id)) {
|
||||
@@ -48,7 +50,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS = 1;
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class KnowledgeRecordTest extends PHPUnit\Framework\TestCase
|
||||
class KnowledgeRecordTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -30,6 +30,7 @@ global $conf,$user,$langs,$db;
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/core/lib/security.lib.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/core/lib/security2.lib.php';
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
if (! defined('NOREQUIREUSER')) {
|
||||
define('NOREQUIREUSER', '1');
|
||||
@@ -77,7 +78,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1;
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class LangTest extends PHPUnit\Framework\TestCase
|
||||
class LangTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -30,6 +30,7 @@ global $conf,$user,$langs,$db;
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/core/lib/security.lib.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/core/lib/security2.lib.php';
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
if (! defined('NOREQUIREUSER')) {
|
||||
define('NOREQUIREUSER', '1');
|
||||
@@ -77,7 +78,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1;
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class LesscTest extends PHPUnit\Framework\TestCase
|
||||
class LesscTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -29,6 +29,7 @@ global $conf,$user,$langs,$db;
|
||||
//require_once 'PHPUnit/Autoload.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/loan/class/loan.class.php';
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
if (empty($user->id)) {
|
||||
print "Load permissions for admin user nb 1\n";
|
||||
@@ -45,7 +46,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1;
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class LoanTest extends PHPUnit\Framework\TestCase
|
||||
class LoanTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -29,6 +29,7 @@ global $conf,$user,$langs,$db;
|
||||
//require_once 'PHPUnit/Autoload.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/margin/lib/margins.lib.php';
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
if (empty($user->id)) {
|
||||
print "Load permissions for admin user nb 1\n";
|
||||
@@ -45,7 +46,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1;
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class MarginsLibTest extends PHPUnit\Framework\TestCase
|
||||
class MarginsLibTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -28,6 +28,7 @@ global $conf,$user,$langs,$db;
|
||||
//define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver
|
||||
//require_once 'PHPUnit/Autoload.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
if (empty($user->id)) {
|
||||
print "Load permissions for admin user nb 1\n";
|
||||
@@ -44,7 +45,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1;
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class ModulesTest extends PHPUnit\Framework\TestCase
|
||||
class ModulesTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -31,6 +31,7 @@ require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/product/stock/class/mouvementstock.class.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/product/stock/class/entrepot.class.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/product/class/product.class.php';
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
if (empty($user->id)) {
|
||||
print "Load permissions for admin user nb 1\n";
|
||||
@@ -47,7 +48,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1;
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class MouvementStockTest extends PHPUnit\Framework\TestCase
|
||||
class MouvementStockTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -28,6 +28,7 @@ global $conf,$user,$langs,$db;
|
||||
//define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver
|
||||
//require_once 'PHPUnit/Autoload.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
if (empty($user->id)) {
|
||||
print "Load permissions for admin user nb 1\n";
|
||||
@@ -44,7 +45,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1;
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class NumberingModulesTest extends PHPUnit\Framework\TestCase
|
||||
class NumberingModulesTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -28,6 +28,7 @@ global $conf,$user,$langs,$db;
|
||||
//require_once 'PHPUnit/Autoload.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/includes/odtphp/odf.php';
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
if (empty($user->id)) {
|
||||
print "Load permissions for admin user nb 1\n";
|
||||
@@ -46,7 +47,7 @@ $langs->load("main");
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class ODFTest extends PHPUnit\Framework\TestCase
|
||||
class ODFTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -30,6 +30,7 @@ global $conf,$user,$langs,$db;
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/core/lib/geturl.lib.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/paypal/lib/paypal.lib.php';
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
if (empty($user->id)) {
|
||||
print "Load permissions for admin user nb 1\n";
|
||||
@@ -46,7 +47,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1;
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class PaypalTest extends PHPUnit\Framework\TestCase
|
||||
class PaypalTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -33,6 +33,7 @@ require_once dirname(__FILE__).'/../../htdocs/compta/facture/class/facture.class
|
||||
require_once dirname(__FILE__).'/../../htdocs/product/class/product.class.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/core/lib/pdf.lib.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/core/lib/doc.lib.php';
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
if (empty($user->id)) {
|
||||
print "Load permissions for admin user nb 1\n";
|
||||
@@ -49,7 +50,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1;
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class PdfDocTest extends PHPUnit\Framework\TestCase
|
||||
class PdfDocTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -29,6 +29,8 @@ global $conf,$user,$langs,$db;
|
||||
//require_once 'PHPUnit/Autoload.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/core/db/pgsql.class.php';
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
$langs->load("dict");
|
||||
|
||||
if (empty($user->id)) {
|
||||
@@ -47,7 +49,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1;
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class PgsqlTest extends PHPUnit\Framework\TestCase
|
||||
class PgsqlTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -31,6 +31,7 @@ global $conf,$user,$langs,$db;
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/core/lib/price.lib.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/compta/facture/class/facture.class.php';
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
if (empty($user->id)) {
|
||||
print "Load permissions for admin user nb 1\n";
|
||||
@@ -51,7 +52,7 @@ if (getDolGlobalString('MAIN_ROUNDING_RULE_TOT')) {
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class PricesTest extends PHPUnit\Framework\TestCase
|
||||
class PricesTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
@@ -63,7 +64,6 @@ class PricesTest extends PHPUnit\Framework\TestCase
|
||||
* We save global variables into local variables
|
||||
*
|
||||
* @param string $name Name
|
||||
* @return PriceTest
|
||||
*/
|
||||
public function __construct($name = '')
|
||||
{
|
||||
|
||||
@@ -29,6 +29,7 @@ global $conf,$user,$langs,$db;
|
||||
//require_once 'PHPUnit/Autoload.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/product/class/product.class.php';
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
if (empty($user->id)) {
|
||||
print "Load permissions for admin user nb 1\n";
|
||||
@@ -45,7 +46,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1;
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class ProductTest extends PHPUnit\Framework\TestCase
|
||||
class ProductTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -28,6 +28,7 @@ global $conf,$user,$langs,$db,$mysoc;
|
||||
//require_once 'PHPUnit/Autoload.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/core/lib/profid.lib.php';
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
if (! defined('NOREQUIREUSER')) {
|
||||
define('NOREQUIREUSER', '1');
|
||||
@@ -69,7 +70,7 @@ if (! defined("NOLOGIN")) {
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class ProfidLibTest extends PHPUnit\Framework\TestCase
|
||||
class ProfidLibTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -30,6 +30,7 @@ global $conf,$user,$langs,$db;
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/projet/class/project.class.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/projet/class/task.class.php';
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
if (empty($user->id)) {
|
||||
print "Load permissions for admin user nb 1\n";
|
||||
@@ -46,7 +47,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1;
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class ProjectTest extends PHPUnit\Framework\TestCase
|
||||
class ProjectTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -29,6 +29,7 @@ global $conf,$user,$langs,$db;
|
||||
//require_once 'PHPUnit/Autoload.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/comm/propal/class/propal.class.php';
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
if (empty($user->id)) {
|
||||
print "Load permissions for admin user nb 1\n";
|
||||
@@ -45,7 +46,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1;
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class PropalTest extends PHPUnit\Framework\TestCase
|
||||
class PropalTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -28,6 +28,8 @@ global $conf,$user,$langs,$db;
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/societe/class/societe.class.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/reception/class/reception.class.php';
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
$langs->load("dict");
|
||||
|
||||
if (empty($user->id)) {
|
||||
@@ -44,7 +46,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1;
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class ReceptionTest extends PHPUnit\Framework\TestCase
|
||||
class ReceptionTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -29,6 +29,7 @@ global $conf,$user,$langs,$db;
|
||||
//require_once 'PHPUnit/Autoload.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/core/lib/files.lib.php';
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
if (! defined('NOREQUIREUSER')) {
|
||||
define('NOREQUIREUSER', '1');
|
||||
@@ -76,7 +77,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1;
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class RepositoryTest extends PHPUnit\Framework\TestCase
|
||||
class RepositoryTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -30,7 +30,7 @@ global $conf,$user,$langs,$db;
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/core/lib/date.lib.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/core/lib/geturl.lib.php';
|
||||
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
if (empty($user->id)) {
|
||||
print "Load permissions for admin user nb 1\n";
|
||||
@@ -48,7 +48,7 @@ $conf->global->MAIN_UMASK='0666';
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class RestAPIContactTest extends PHPUnit\Framework\TestCase
|
||||
class RestAPIContactTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -30,6 +30,7 @@ require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/core/lib/date.lib.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/core/lib/geturl.lib.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/core/lib/files.lib.php';
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
if (empty($user->id)) {
|
||||
echo "Load permissions for admin user nb 1\n";
|
||||
@@ -46,7 +47,7 @@ $conf->global->MAIN_UMASK = '0666';
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class RestAPIDocumentTest extends PHPUnit\Framework\TestCase
|
||||
class RestAPIDocumentTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -30,7 +30,7 @@ global $conf,$user,$langs,$db;
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/core/lib/date.lib.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/core/lib/geturl.lib.php';
|
||||
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
if (empty($user->id)) {
|
||||
print "Load permissions for admin user nb 1\n";
|
||||
@@ -48,7 +48,7 @@ $conf->global->MAIN_UMASK='0666';
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class RestAPIUserTest extends PHPUnit\Framework\TestCase
|
||||
class RestAPIUserTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -30,6 +30,7 @@ global $conf,$user,$langs,$db;
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/core/lib/security.lib.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/core/lib/security2.lib.php';
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
if (! defined('NOREQUIREUSER')) {
|
||||
define('NOREQUIREUSER', '1');
|
||||
@@ -77,7 +78,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1;
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class ScriptsTest extends PHPUnit\Framework\TestCase
|
||||
class ScriptsTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -56,7 +56,7 @@ if (! defined("NOSESSION")) {
|
||||
require_once dirname(__FILE__).'/../../htdocs/main.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/core/lib/security.lib.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/core/lib/security2.lib.php';
|
||||
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
if (empty($user->id)) {
|
||||
print "Load permissions for admin user nb 1\n";
|
||||
@@ -73,7 +73,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1;
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class SecurityTest extends PHPUnit\Framework\TestCase
|
||||
class SecurityTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
@@ -133,34 +133,6 @@ class SecurityTest extends PHPUnit\Framework\TestCase
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This method is called when a test fails
|
||||
*
|
||||
* @param Throwable $t Throwable object
|
||||
* @return void
|
||||
*/
|
||||
protected function onNotSuccessfulTest(Throwable $t): void
|
||||
{
|
||||
$logfile = DOL_DATA_ROOT.'/dolibarr.log';
|
||||
|
||||
$lines = file($logfile);
|
||||
|
||||
$nbLinesToShow = 100;
|
||||
$totalLines = count($lines);
|
||||
$premiereLigne = max(0, $totalLines - $nbLinesToShow);
|
||||
|
||||
// Obtient les dernières lignes du tableau
|
||||
$dernieresLignes = array_slice($lines, $premiereLigne, $nbLinesToShow);
|
||||
|
||||
// Show log file
|
||||
print "\n----- Test fails. Show last ".$nbLinesToShow." lines of dolibarr.log file -----\n";
|
||||
foreach ($dernieresLignes as $ligne) {
|
||||
print $ligne . "<br>";
|
||||
}
|
||||
|
||||
parent::onNotSuccessfulTest($t);
|
||||
}
|
||||
|
||||
/**
|
||||
* Init phpunit tests
|
||||
*
|
||||
|
||||
@@ -29,6 +29,8 @@ global $conf,$user,$langs,$db;
|
||||
//require_once 'PHPUnit/Autoload.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/societe/class/societe.class.php';
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
$langs->load("dict");
|
||||
|
||||
if (empty($user->id)) {
|
||||
@@ -46,7 +48,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1;
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class SocieteTest extends PHPUnit\Framework\TestCase
|
||||
class SocieteTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -30,6 +30,7 @@ global $conf,$user,$langs,$db;
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/core/lib/geturl.lib.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/stripe/lib/stripe.lib.php';
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
if (empty($user->id)) {
|
||||
print "Load permissions for admin user nb 1\n";
|
||||
@@ -46,7 +47,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1;
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class StripeTest extends PHPUnit\Framework\TestCase
|
||||
class StripeTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -29,6 +29,7 @@ global $conf,$user,$langs,$db;
|
||||
//require_once 'PHPUnit/Autoload.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/supplier_proposal/class/supplier_proposal.class.php';
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
if (empty($user->id)) {
|
||||
print "Load permissions for user nb 1 (that should be admin)\n";
|
||||
@@ -48,7 +49,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1;
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class SupplierProposalTest extends PHPUnit\Framework\TestCase
|
||||
class SupplierProposalTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -29,6 +29,7 @@ global $conf, $user, $langs, $db;
|
||||
//require_once 'PHPUnit/Autoload.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/webhook/class/target.class.php';
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
if (empty($user->id)) {
|
||||
print "Load permissions for admin user nb 1\n";
|
||||
@@ -47,7 +48,7 @@ $langs->load("main");
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class TargetTest extends PHPUnit\Framework\TestCase
|
||||
class TargetTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -30,6 +30,7 @@ global $conf,$user,$langs,$db;
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/user/class/usergroup.class.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/ticket/class/ticket.class.php';
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
if (empty($user->id)) {
|
||||
print "Load permissions for admin user nb 1\n";
|
||||
@@ -46,7 +47,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1;
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class TicketTest extends PHPUnit\Framework\TestCase
|
||||
class TicketTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -29,6 +29,7 @@ global $conf,$user,$langs,$db;
|
||||
//require_once 'PHPUnit/Autoload.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/user/class/usergroup.class.php';
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
if (empty($user->id)) {
|
||||
print "Load permissions for admin user nb 1\n";
|
||||
@@ -45,7 +46,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1;
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class UserGroupTest extends PHPUnit\Framework\TestCase
|
||||
class UserGroupTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -29,6 +29,7 @@ global $conf,$user,$langs,$db;
|
||||
//require_once 'PHPUnit/Autoload.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/user/class/user.class.php';
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
if (empty($user->id)) {
|
||||
print "Load permissions for admin user nb 1\n";
|
||||
@@ -45,7 +46,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1;
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class UserTest extends PHPUnit\Framework\TestCase
|
||||
class UserTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -29,6 +29,7 @@ global $conf,$user,$langs,$db;
|
||||
//require_once 'PHPUnit/Autoload.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/core/class/utils.class.php';
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
if (empty($user->id)) {
|
||||
print "Load permissions for admin user nb 1\n";
|
||||
@@ -45,7 +46,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1;
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class UtilsTest extends PHPUnit\Framework\TestCase
|
||||
class UtilsTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -30,7 +30,7 @@ global $conf,$user,$langs,$db;
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/core/lib/date.lib.php';
|
||||
require_once NUSOAP_PATH.'/nusoap.php'; // Include SOAP
|
||||
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
if (empty($user->id)) {
|
||||
print "Load permissions for admin user nb 1\n";
|
||||
@@ -49,7 +49,7 @@ $conf->global->MAIN_UMASK='0666';
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class WebservicesInvoicesTest extends PHPUnit\Framework\TestCase
|
||||
class WebservicesInvoicesTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -30,7 +30,7 @@ global $conf,$user,$langs,$db;
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/core/lib/date.lib.php';
|
||||
require_once NUSOAP_PATH.'/nusoap.php'; // Include SOAP
|
||||
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
if (empty($user->id)) {
|
||||
print "Load permissions for admin user nb 1\n";
|
||||
@@ -49,7 +49,7 @@ $conf->global->MAIN_UMASK='0666';
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class WebservicesOrdersTest extends PHPUnit\Framework\TestCase
|
||||
class WebservicesOrdersTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -30,7 +30,7 @@ global $conf,$user,$langs,$db;
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/core/lib/date.lib.php';
|
||||
require_once NUSOAP_PATH.'/nusoap.php'; // Include SOAP
|
||||
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
if (empty($user->id)) {
|
||||
print "Load permissions for admin user nb 1\n";
|
||||
@@ -49,7 +49,7 @@ $conf->global->MAIN_UMASK='0666';
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class WebservicesOtherTest extends PHPUnit\Framework\TestCase
|
||||
class WebservicesOtherTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -32,7 +32,7 @@ global $conf,$user,$langs,$db;
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/core/lib/date.lib.php';
|
||||
require_once NUSOAP_PATH.'/nusoap.php'; // Include SOAP
|
||||
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
if (empty($user->id)) {
|
||||
print "Load permissions for admin user nb 1\n";
|
||||
@@ -55,7 +55,7 @@ if (!isModEnabled('service')) {
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class WebservicesProductsTest extends PHPUnit\Framework\TestCase
|
||||
class WebservicesProductsTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -30,7 +30,7 @@ global $conf,$user,$langs,$db;
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/core/lib/date.lib.php';
|
||||
require_once NUSOAP_PATH.'/nusoap.php'; // Include SOAP
|
||||
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
if (empty($user->id)) {
|
||||
print "Load permissions for admin user nb 1\n";
|
||||
@@ -49,7 +49,7 @@ $conf->global->MAIN_UMASK='0666';
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class WebservicesThirdpartyTest extends PHPUnit\Framework\TestCase
|
||||
class WebservicesThirdpartyTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -30,7 +30,7 @@ global $conf,$user,$langs,$db;
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/core/lib/date.lib.php';
|
||||
require_once NUSOAP_PATH.'/nusoap.php'; // Include SOAP
|
||||
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
if (empty($user->id)) {
|
||||
print "Load permissions for admin user nb 1\n";
|
||||
@@ -49,7 +49,7 @@ $conf->global->MAIN_UMASK='0666';
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class WebservicesUserTest extends PHPUnit\Framework\TestCase
|
||||
class WebservicesUserTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
global $conf,$user,$langs,$db;
|
||||
//define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver
|
||||
//require_once 'PHPUnit/Autoload.php';
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
if (! defined('NOREQUIRESOC')) {
|
||||
define('NOREQUIRESOC', '1');
|
||||
@@ -78,7 +79,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1;
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class WebsiteTest extends PHPUnit\Framework\TestCase
|
||||
class WebsiteTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
@@ -29,6 +29,7 @@ global $conf,$user,$langs,$db;
|
||||
//require_once 'PHPUnit/Autoload.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/core/lib/xcal.lib.php';
|
||||
require_once dirname(__FILE__).'/CommonClassTest.class.php';
|
||||
|
||||
if (empty($user->id)) {
|
||||
print "Load permissions for admin user nb 1\n";
|
||||
@@ -45,7 +46,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1;
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class XCalLibTest extends PHPUnit\Framework\TestCase
|
||||
class XCalLibTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
|
||||
Reference in New Issue
Block a user