Fix bad test

This commit is contained in:
Laurent Destailleur 2021-05-12 08:42:33 +02:00
parent dd7ed720e5
commit 4da5aeedf4
17 changed files with 28 additions and 28 deletions

View File

@ -84,7 +84,7 @@ class ActionCommTest extends PHPUnit\Framework\TestCase
$db->begin(); // This is to have all actions inside a transaction even if test launched without suite.
if (empty($conf->agenda->enabled)) {
print __METHOD__." module agenda must be enabled.\n"; die();
print __METHOD__." module agenda must be enabled.\n"; die(1);
}
print __METHOD__."\n";

View File

@ -87,13 +87,13 @@ class AdherentTest extends PHPUnit\Framework\TestCase
if (! empty($conf->global->MAIN_FIRSTNAME_NAME_POSITION)) {
print "\n".__METHOD__." Company must be setup to have name-firstname in order 'Firstname Lastname'\n";
die();
die(1);
}
if (! empty($conf->global->MAIN_MODULE_LDAP)) {
print "\n".__METHOD__." module LDAP must be disabled.\n"; die();
print "\n".__METHOD__." module LDAP must be disabled.\n"; die(1);
}
if (! empty($conf->global->MAIN_MODULE_MAILMANSPIP)) {
print "\n".__METHOD__." module MailmanSpip must be disabled.\n"; die();
print "\n".__METHOD__." module MailmanSpip must be disabled.\n"; die(1);
}
print __METHOD__."\n";

View File

@ -113,25 +113,25 @@ class BuildDocTest extends PHPUnit\Framework\TestCase
global $conf,$user,$langs,$db;
if (! $conf->facture->enabled) {
print __METHOD__." invoice module not enabled\n"; die();
print __METHOD__." invoice module not enabled\n"; die(1);
}
if (! $conf->commande->enabled) {
print __METHOD__." order module not enabled\n"; die();
print __METHOD__." order module not enabled\n"; die(1);
}
if (! $conf->propal->enabled) {
print __METHOD__." propal module not enabled\n"; die();
print __METHOD__." propal module not enabled\n"; die(1);
}
if (! $conf->projet->enabled) {
print __METHOD__." project module not enabled\n"; die();
print __METHOD__." project module not enabled\n"; die(1);
}
if (! $conf->expedition->enabled) {
print __METHOD__." shipment module not enabled\n"; die();
print __METHOD__." shipment module not enabled\n"; die(1);
}
if (! $conf->ficheinter->enabled) {
print __METHOD__." intervention module not enabled\n"; die();
print __METHOD__." intervention module not enabled\n"; die(1);
}
if (! $conf->expensereport->enabled) {
print __METHOD__." expensereport module not enabled\n"; die();
print __METHOD__." expensereport module not enabled\n"; die(1);
}
$db->begin(); // This is to have all actions inside a transaction even if test launched without suite.

View File

@ -147,7 +147,7 @@ class CommandeFournisseurTest extends PHPUnit\Framework\TestCase
$product=new ProductFournisseur($db);
$product->fetch(0, 'PIDRESS');
if ($product->id <= 0) {
print "\n".__METHOD__." A product with ref PIDRESS must exists into database"; die();
print "\n".__METHOD__." A product with ref PIDRESS must exists into database"; die(1);
}
$quantity=10;

View File

@ -84,7 +84,7 @@ class CommandeTest extends PHPUnit\Framework\TestCase
$db->begin(); // This is to have all actions inside a transaction even if test launched without suite.
if (empty($conf->commande->enabled)) {
print __METHOD__." module customer order must be enabled.\n"; die();
print __METHOD__." module customer order must be enabled.\n"; die(1);
}
print __METHOD__."\n";

View File

@ -83,7 +83,7 @@ class DateLibTzFranceTest extends PHPUnit\Framework\TestCase
global $conf,$user,$langs,$db;
if (getServerTimeZoneString() != 'Europe/Paris' && getServerTimeZoneString() != 'Europe/Berlin') {
print "\n".__METHOD__." This PHPUnit test can be launched manually only onto a server with PHP timezone set to TZ=Europe/Paris, not a TZ=".getServerTimeZoneString().".\n"; die();
print "\n".__METHOD__." This PHPUnit test can be launched manually only onto a server with PHP timezone set to TZ=Europe/Paris, not a TZ=".getServerTimeZoneString().".\n"; die(1);
}
$db->begin(); // This is to have all actions inside a transaction even if test launched without suite.

View File

@ -83,7 +83,7 @@ class EntrepotTest extends PHPUnit\Framework\TestCase
global $conf,$user,$langs,$db;
if (empty($conf->stock->enabled)) {
print __METHOD__." Module Stock must be enabled.\n"; die();
print __METHOD__." Module Stock must be enabled.\n"; die(1);
}
$db->begin(); // This is to have all actions inside a transaction even if test launched without suite.

View File

@ -84,10 +84,10 @@ class FactureTest extends PHPUnit\Framework\TestCase
global $conf,$user,$langs,$db;
if (empty($conf->facture->enabled)) {
print __METHOD__." module customer invoice must be enabled.\n"; die();
print __METHOD__." module customer invoice must be enabled.\n"; die(1);
}
if (! empty($conf->ecotaxdeee->enabled)) {
print __METHOD__." ecotaxdeee module must not be enabled.\n"; die();
print __METHOD__." ecotaxdeee module must not be enabled.\n"; die(1);
}
$db->begin(); // This is to have all actions inside a transaction even if test launched without suite.

View File

@ -115,7 +115,7 @@ class MouvementStockTest extends PHPUnit\Framework\TestCase
$db=$this->savdb;
if (empty($conf->productbatch->enabled)) {
print "\n".__METHOD__." module Lot/Serial must be enabled.\n"; die();
print "\n".__METHOD__." module Lot/Serial must be enabled.\n"; die(1);
}
print __METHOD__."\n";

View File

@ -84,7 +84,7 @@ class PaypalTest extends PHPUnit\Framework\TestCase
global $conf,$user,$langs,$db;
if (empty($conf->paypal->enabled)) {
print __METHOD__." Module Paypal must be enabled.\n"; die();
print __METHOD__." Module Paypal must be enabled.\n"; die(1);
}
$db->begin(); // This is to have all actions inside a transaction even if test launched without suite.

View File

@ -144,7 +144,7 @@ class PdfDocTest extends PHPUnit\Framework\TestCase
$localproduct->fetch(0, 'PIDRESS');
$product_id=$localproduct->id;
if ($product_id <= 0) {
print "\n".__METHOD__." A product with ref PIDRESS must exists into database"; die();
print "\n".__METHOD__." A product with ref PIDRESS must exists into database"; die(1);
}
$localobject=new Facture($this->savdb);

View File

@ -83,7 +83,7 @@ class ProductTest extends PHPUnit\Framework\TestCase
global $conf,$user,$langs,$db;
if (empty($conf->produit->enabled)) {
print __METHOD__." Module Product must be enabled.\n"; die();
print __METHOD__." Module Product must be enabled.\n"; die(1);
}
$db->begin(); // This is to have all actions inside a transaction even if test launched without suite.

View File

@ -74,7 +74,7 @@ class RestAPIUserTest extends PHPUnit\Framework\TestCase
$this->savdb=$db;
if (empty($conf->api->enabled)) {
print __METHOD__." module api must be enabled.\n"; die();
print __METHOD__." module api must be enabled.\n"; die(1);
}
print __METHOD__." db->type=".$db->type." user->id=".$user->id;

View File

@ -84,15 +84,15 @@ class SocieteTest extends PHPUnit\Framework\TestCase
global $conf,$user,$langs,$db;
if ($conf->global->SOCIETE_CODECLIENT_ADDON != 'mod_codeclient_monkey') {
print "\n".__METHOD__." third party ref checker must be setup to 'mod_codeclient_monkey' not to '".$conf->global->SOCIETE_CODECLIENT_ADDON."'.\n"; die();
print "\n".__METHOD__." third party ref checker must be setup to 'mod_codeclient_monkey' not to '".$conf->global->SOCIETE_CODECLIENT_ADDON."'.\n"; die(1);
}
if (! empty($conf->global->MAIN_DISABLEPROFIDRULES)) {
print "\n".__METHOD__." constant MAIN_DISABLEPROFIDRULES must be empty (if a module set it, disable module).\n"; die();
print "\n".__METHOD__." constant MAIN_DISABLEPROFIDRULES must be empty (if a module set it, disable module).\n"; die(1);
}
if ($langs->defaultlang != 'en_US') {
print "\n".__METHOD__." default language of company must be set to autodetect.\n"; die();
print "\n".__METHOD__." default language of company must be set to autodetect.\n"; die(1);
}
$db->begin(); // This is to have all actions inside a transaction even if test launched without suite.

View File

@ -84,7 +84,7 @@ class StripeTest extends PHPUnit\Framework\TestCase
global $conf,$user,$langs,$db;
if (empty($conf->stripe->enabled)) {
print __METHOD__." Module Stripe must be enabled.\n"; die();
print __METHOD__." Module Stripe must be enabled.\n"; die(1);
}
$db->begin(); // This is to have all actions inside a transaction even if test launched without suite.

View File

@ -87,7 +87,7 @@ class SupplierProposalTest extends PHPUnit\Framework\TestCase
$db->begin(); // This is to have all actions inside a transaction even if test launched without suite.
if (empty($conf->global->MAIN_MODULE_SUPPLIERPROPOSAL)) {
print "\n".__METHOD__." module Supplier proposal must be enabled.\n"; die();
print "\n".__METHOD__." module Supplier proposal must be enabled.\n"; die(1);
}
print __METHOD__."\n";

View File

@ -83,7 +83,7 @@ class UserTest extends PHPUnit\Framework\TestCase
global $conf,$user,$langs,$db;
if (! empty($conf->global->MAIN_MODULE_LDAP)) {
print "\n".__METHOD__." module LDAP must be disabled.\n"; die();
print "\n".__METHOD__." module LDAP must be disabled.\n"; die(1);
}
$db->begin(); // This is to have all actions inside a transaction even if test launched without suite.