mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-05 17:18:13 +01:00
Compare commits
20 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d7f7f5bf3d | ||
|
|
7c0a6946a7 | ||
|
|
1ecc1afa9e | ||
|
|
ceb1e699b7 | ||
|
|
c028819cab | ||
|
|
d59b1bb0c6 | ||
|
|
9d582a53ca | ||
|
|
8eac45a762 | ||
|
|
3d85407619 | ||
|
|
ca1e3b4d55 | ||
|
|
94bb1ac511 | ||
|
|
8893d8d59f | ||
|
|
5bab9d59b2 | ||
|
|
e41b55af13 | ||
|
|
a69c3caf2c | ||
|
|
e03d7eba8c | ||
|
|
2aa0956f15 | ||
|
|
bb09bcece4 | ||
|
|
e61bcd03ed | ||
|
|
3295498e9e |
@@ -131,10 +131,10 @@ before_script:
|
|||||||
echo "Set timezone"
|
echo "Set timezone"
|
||||||
echo 'date.timezone = "Europe/Paris"' >> ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php.ini
|
echo 'date.timezone = "Europe/Paris"' >> ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php.ini
|
||||||
if [ "$TRAVIS_PHP_VERSION" = '5.3' ] || [ "$TRAVIS_PHP_VERSION" = '5.4' ]; then
|
if [ "$TRAVIS_PHP_VERSION" = '5.3' ] || [ "$TRAVIS_PHP_VERSION" = '5.4' ]; then
|
||||||
echo
|
#echo
|
||||||
echo "Enabling APC for PHP <= 5.4"
|
#echo "Enabling APC for PHP <= 5.4"
|
||||||
# Documentation says it should be available for PHP <= 5.6 but it's not for 5.5 and 5.6!
|
# Documentation says it should be available for PHP <= 5.6 but it's not for 5.5 and 5.6!
|
||||||
echo 'extension = apc.so' >> ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php.ini
|
#echo 'extension = apc.so' >> ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php.ini
|
||||||
echo
|
echo
|
||||||
echo "Enabling Memcached for PHP <= 5.4"
|
echo "Enabling Memcached for PHP <= 5.4"
|
||||||
# Documentation says it should be available for all PHP versions but it's not for 5.5 and 5.6, 7.0 and nightly!
|
# Documentation says it should be available for all PHP versions but it's not for 5.5 and 5.6, 7.0 and nightly!
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# DOLIBARR ERP & CRM
|
# DOLIBARR ERP & CRM
|
||||||
|
|
||||||
 
|
 
|
||||||
|
|
||||||
Dolibarr ERP & CRM is a modern software package to manage your organization's activity (contacts, suppliers, invoices, orders, stocks, agenda, ...).
|
Dolibarr ERP & CRM is a modern software package to manage your organization's activity (contacts, suppliers, invoices, orders, stocks, agenda, ...).
|
||||||
|
|
||||||
|
|||||||
@@ -1143,6 +1143,7 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
$this->lines[$i]->remise_percent,
|
$this->lines[$i]->remise_percent,
|
||||||
'HT',
|
'HT',
|
||||||
0,
|
0,
|
||||||
|
$this->lines[$i]->product_type,
|
||||||
$this->lines[$i]->info_bits
|
$this->lines[$i]->info_bits
|
||||||
);
|
);
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
|
|||||||
@@ -61,7 +61,9 @@ class AdherentTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
//$this->sharedFixture
|
parent::__construct();
|
||||||
|
|
||||||
|
//$this->sharedFixture
|
||||||
global $conf,$user,$langs,$db;
|
global $conf,$user,$langs,$db;
|
||||||
$this->savconf=$conf;
|
$this->savconf=$conf;
|
||||||
$this->savuser=$user;
|
$this->savuser=$user;
|
||||||
@@ -79,7 +81,7 @@ class AdherentTest extends PHPUnit_Framework_TestCase
|
|||||||
global $conf,$user,$langs,$db;
|
global $conf,$user,$langs,$db;
|
||||||
$db->begin(); // This is to have all actions inside a transaction even if test launched without suite.
|
$db->begin(); // This is to have all actions inside a transaction even if test launched without suite.
|
||||||
|
|
||||||
if (! empty($conf->global->MAIN_FIRSTNAME_NAME_POSITION)) {
|
if (! empty($conf->global->MAIN_FIRSTNAME_NAME_POSITION)) {
|
||||||
print "\n".__METHOD__." Company must be setup to have name-firstname in order 'Firstname Lastname'\n";
|
print "\n".__METHOD__." Company must be setup to have name-firstname in order 'Firstname Lastname'\n";
|
||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,7 +59,9 @@ class AdminLibTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
//$this->sharedFixture
|
parent::__construct();
|
||||||
|
|
||||||
|
//$this->sharedFixture
|
||||||
global $conf,$user,$langs,$db;
|
global $conf,$user,$langs,$db;
|
||||||
$this->savconf=$conf;
|
$this->savconf=$conf;
|
||||||
$this->savuser=$user;
|
$this->savuser=$user;
|
||||||
@@ -142,21 +144,21 @@ class AdminLibTest extends PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testEnableModule
|
* testEnableModule
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function testEnableModule()
|
public function testEnableModule()
|
||||||
{
|
{
|
||||||
global $conf, $db, $langs, $user;
|
global $conf, $db, $langs, $user;
|
||||||
|
|
||||||
require_once dirname(__FILE__).'/../../htdocs/core/modules/modExpenseReport.class.php';
|
require_once dirname(__FILE__).'/../../htdocs/core/modules/modExpenseReport.class.php';
|
||||||
print "Enable module modExpenseReport";
|
print "Enable module modExpenseReport";
|
||||||
$moduledescriptor=new modExpenseReport($db);
|
$moduledescriptor=new modExpenseReport($db);
|
||||||
$moduledescriptor->init();
|
$moduledescriptor->init();
|
||||||
$conf->setValues($db);
|
$conf->setValues($db);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,7 +61,9 @@ class BankAccountTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
//$this->sharedFixture
|
parent::__construct();
|
||||||
|
|
||||||
|
//$this->sharedFixture
|
||||||
global $conf,$user,$langs,$db;
|
global $conf,$user,$langs,$db;
|
||||||
$this->savconf=$conf;
|
$this->savconf=$conf;
|
||||||
$this->savuser=$user;
|
$this->savuser=$user;
|
||||||
|
|||||||
@@ -62,6 +62,8 @@ class BonPrelevementTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
|
parent::__construct();
|
||||||
|
|
||||||
//$this->sharedFixture
|
//$this->sharedFixture
|
||||||
global $conf,$user,$langs,$db;
|
global $conf,$user,$langs,$db;
|
||||||
$this->savconf=$conf;
|
$this->savconf=$conf;
|
||||||
|
|||||||
@@ -89,7 +89,9 @@ class BuildDocTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
//$this->sharedFixture
|
parent::__construct();
|
||||||
|
|
||||||
|
//$this->sharedFixture
|
||||||
global $conf,$user,$langs,$db;
|
global $conf,$user,$langs,$db;
|
||||||
$this->savconf=$conf;
|
$this->savconf=$conf;
|
||||||
$this->savuser=$user;
|
$this->savuser=$user;
|
||||||
|
|||||||
@@ -59,7 +59,9 @@ class CMailFileTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
//$this->sharedFixture
|
parent::__construct();
|
||||||
|
|
||||||
|
//$this->sharedFixture
|
||||||
global $conf,$user,$langs,$db;
|
global $conf,$user,$langs,$db;
|
||||||
$this->savconf=$conf;
|
$this->savconf=$conf;
|
||||||
$this->savuser=$user;
|
$this->savuser=$user;
|
||||||
@@ -103,7 +105,7 @@ class CMailFileTest extends PHPUnit_Framework_TestCase
|
|||||||
$db=$this->savdb;
|
$db=$this->savdb;
|
||||||
|
|
||||||
$conf->global->MAIN_DISABLE_ALL_MAILS=1; // If I comment/remove this lien, unit test still works alone but failed when ran from AllTest. Don't know why.
|
$conf->global->MAIN_DISABLE_ALL_MAILS=1; // If I comment/remove this lien, unit test still works alone but failed when ran from AllTest. Don't know why.
|
||||||
|
|
||||||
print __METHOD__."\n";
|
print __METHOD__."\n";
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -60,7 +60,9 @@ class CategorieTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
//$this->sharedFixture
|
parent::__construct();
|
||||||
|
|
||||||
|
//$this->sharedFixture
|
||||||
global $conf,$user,$langs,$db;
|
global $conf,$user,$langs,$db;
|
||||||
$this->savconf=$conf;
|
$this->savconf=$conf;
|
||||||
$this->savuser=$user;
|
$this->savuser=$user;
|
||||||
|
|||||||
@@ -60,6 +60,8 @@ class ChargeSocialesTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
|
parent::__construct();
|
||||||
|
|
||||||
//$this->sharedFixture
|
//$this->sharedFixture
|
||||||
global $conf,$user,$langs,$db;
|
global $conf,$user,$langs,$db;
|
||||||
$this->savconf=$conf;
|
$this->savconf=$conf;
|
||||||
@@ -117,7 +119,7 @@ class ChargeSocialesTest extends PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* testChargeSocialesCreate
|
* testChargeSocialesCreate
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function testChargeSocialesCreate()
|
public function testChargeSocialesCreate()
|
||||||
@@ -139,10 +141,10 @@ class ChargeSocialesTest extends PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* testChargeSocialesFetch
|
* testChargeSocialesFetch
|
||||||
*
|
*
|
||||||
* @param int $id Id of social contribution
|
* @param int $id Id of social contribution
|
||||||
* @return void
|
* @return void
|
||||||
*
|
*
|
||||||
* @depends testChargeSocialesCreate
|
* @depends testChargeSocialesCreate
|
||||||
* The depends says test is run only if previous is ok
|
* The depends says test is run only if previous is ok
|
||||||
*/
|
*/
|
||||||
@@ -164,10 +166,10 @@ class ChargeSocialesTest extends PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* testChargeSocialesValid
|
* testChargeSocialesValid
|
||||||
*
|
*
|
||||||
* @param Object $localobject Social contribution
|
* @param Object $localobject Social contribution
|
||||||
* @return void
|
* @return void
|
||||||
*
|
*
|
||||||
* @depends testChargeSocialesFetch
|
* @depends testChargeSocialesFetch
|
||||||
* The depends says test is run only if previous is ok
|
* The depends says test is run only if previous is ok
|
||||||
*/
|
*/
|
||||||
@@ -188,10 +190,10 @@ class ChargeSocialesTest extends PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* testChargeSocialesOther
|
* testChargeSocialesOther
|
||||||
*
|
*
|
||||||
* @param Object $localobject Social contribution
|
* @param Object $localobject Social contribution
|
||||||
* @return void
|
* @return void
|
||||||
*
|
*
|
||||||
* @depends testChargeSocialesValid
|
* @depends testChargeSocialesValid
|
||||||
* The depends says test is run only if previous is ok
|
* The depends says test is run only if previous is ok
|
||||||
*/
|
*/
|
||||||
@@ -216,10 +218,10 @@ class ChargeSocialesTest extends PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* testChargeSocialesDelete
|
* testChargeSocialesDelete
|
||||||
*
|
*
|
||||||
* @param int $id Social contribution
|
* @param int $id Social contribution
|
||||||
* @return void
|
* @return void
|
||||||
*
|
*
|
||||||
* @depends testChargeSocialesOther
|
* @depends testChargeSocialesOther
|
||||||
* The depends says test is run only if previous is ok
|
* The depends says test is run only if previous is ok
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -61,7 +61,9 @@ class CommandeFournisseurTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
//$this->sharedFixture
|
parent::__construct();
|
||||||
|
|
||||||
|
//$this->sharedFixture
|
||||||
global $conf,$user,$langs,$db;
|
global $conf,$user,$langs,$db;
|
||||||
$this->savconf=$conf;
|
$this->savconf=$conf;
|
||||||
$this->savuser=$user;
|
$this->savuser=$user;
|
||||||
|
|||||||
@@ -59,7 +59,9 @@ class CommandeTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
//$this->sharedFixture
|
parent::__construct();
|
||||||
|
|
||||||
|
//$this->sharedFixture
|
||||||
global $conf,$user,$langs,$db;
|
global $conf,$user,$langs,$db;
|
||||||
$this->savconf=$conf;
|
$this->savconf=$conf;
|
||||||
$this->savuser=$user;
|
$this->savuser=$user;
|
||||||
|
|||||||
@@ -60,7 +60,9 @@ class CommonObjectTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
//$this->sharedFixture
|
parent::__construct();
|
||||||
|
|
||||||
|
//$this->sharedFixture
|
||||||
global $conf,$user,$langs,$db;
|
global $conf,$user,$langs,$db;
|
||||||
$this->savconf=$conf;
|
$this->savconf=$conf;
|
||||||
$this->savuser=$user;
|
$this->savuser=$user;
|
||||||
|
|||||||
@@ -60,6 +60,8 @@ class CompanyBankAccountTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
|
parent::__construct();
|
||||||
|
|
||||||
//$this->sharedFixture
|
//$this->sharedFixture
|
||||||
global $conf,$user,$langs,$db;
|
global $conf,$user,$langs,$db;
|
||||||
$this->savconf=$conf;
|
$this->savconf=$conf;
|
||||||
|
|||||||
@@ -68,6 +68,8 @@ class ContactTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
|
parent::__construct();
|
||||||
|
|
||||||
//$this->sharedFixture
|
//$this->sharedFixture
|
||||||
global $conf,$user,$langs,$db;
|
global $conf,$user,$langs,$db;
|
||||||
$this->savconf=$conf;
|
$this->savconf=$conf;
|
||||||
@@ -207,7 +209,7 @@ class ContactTest extends PHPUnit_Framework_TestCase
|
|||||||
$localobject->email='newemail@newemail.com';
|
$localobject->email='newemail@newemail.com';
|
||||||
$localobject->jabberid='New im id';
|
$localobject->jabberid='New im id';
|
||||||
$localobject->default_lang='es_ES';
|
$localobject->default_lang='es_ES';
|
||||||
|
|
||||||
$result=$localobject->update($localobject->id,$user);
|
$result=$localobject->update($localobject->id,$user);
|
||||||
print __METHOD__." id=".$localobject->id." result=".$result."\n";
|
print __METHOD__." id=".$localobject->id." result=".$result."\n";
|
||||||
$this->assertLessThan($result, 0, 'Contact::update error');
|
$this->assertLessThan($result, 0, 'Contact::update error');
|
||||||
|
|||||||
@@ -60,6 +60,8 @@ class ContratTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
|
parent::__construct();
|
||||||
|
|
||||||
//$this->sharedFixture
|
//$this->sharedFixture
|
||||||
global $conf,$user,$langs,$db;
|
global $conf,$user,$langs,$db;
|
||||||
$this->savconf=$conf;
|
$this->savconf=$conf;
|
||||||
|
|||||||
@@ -62,7 +62,9 @@ class CoreTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
//$this->sharedFixture
|
parent::__construct();
|
||||||
|
|
||||||
|
//$this->sharedFixture
|
||||||
global $conf,$user,$langs,$db;
|
global $conf,$user,$langs,$db;
|
||||||
$this->savconf=$conf;
|
$this->savconf=$conf;
|
||||||
$this->savuser=$user;
|
$this->savuser=$user;
|
||||||
@@ -290,22 +292,22 @@ class CoreTest extends PHPUnit_Framework_TestCase
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Run tests
|
// Run tests
|
||||||
|
|
||||||
$_SERVER["PHP_SELF"]='/DIR WITH SPACE/htdocs/admin/index.php?mainmenu=home&leftmenu=setup&username=weservices';
|
$_SERVER["PHP_SELF"]='/DIR WITH SPACE/htdocs/admin/index.php?mainmenu=home&leftmenu=setup&username=weservices';
|
||||||
$result=test_sql_and_script_inject($_SERVER["PHP_SELF"], 2);
|
$result=test_sql_and_script_inject($_SERVER["PHP_SELF"], 2);
|
||||||
$expectedresult=0;
|
$expectedresult=0;
|
||||||
$this->assertEquals($expectedresult, $result, 'Error on test_sql_and_script_inject 1a');
|
$this->assertEquals($expectedresult, $result, 'Error on test_sql_and_script_inject 1a');
|
||||||
|
|
||||||
$_SERVER["PHP_SELF"]='/DIR WITH SPACE/htdocs/admin/index.php?mainmenu=home&leftmenu=setup&username=weservices;badaction';
|
$_SERVER["PHP_SELF"]='/DIR WITH SPACE/htdocs/admin/index.php?mainmenu=home&leftmenu=setup&username=weservices;badaction';
|
||||||
$result=test_sql_and_script_inject($_SERVER["PHP_SELF"], 2);
|
$result=test_sql_and_script_inject($_SERVER["PHP_SELF"], 2);
|
||||||
$expectedresult=1;
|
$expectedresult=1;
|
||||||
$this->assertEquals($expectedresult, $result, 'Error on test_sql_and_script_inject 1b');
|
$this->assertEquals($expectedresult, $result, 'Error on test_sql_and_script_inject 1b');
|
||||||
|
|
||||||
$_GET['aaa']="<img src='1.jpg' onerror =javascript:alert('XSS')>";
|
$_GET['aaa']="<img src='1.jpg' onerror =javascript:alert('XSS')>";
|
||||||
$result=test_sql_and_script_inject($_GET['aaa'], 0);
|
$result=test_sql_and_script_inject($_GET['aaa'], 0);
|
||||||
$expectedresult=1;
|
$expectedresult=1;
|
||||||
$this->assertEquals($expectedresult, $result, 'Error on test_sql_and_script_inject 2');
|
$this->assertEquals($expectedresult, $result, 'Error on test_sql_and_script_inject 2');
|
||||||
|
|
||||||
$_POST['bbb']="<img src='1.jpg' onerror =javascript:alert('XSS')>";
|
$_POST['bbb']="<img src='1.jpg' onerror =javascript:alert('XSS')>";
|
||||||
$result=test_sql_and_script_inject($_POST['bbb'], 2);
|
$result=test_sql_and_script_inject($_POST['bbb'], 2);
|
||||||
$expectedresult=1;
|
$expectedresult=1;
|
||||||
|
|||||||
@@ -60,6 +60,8 @@ class DateLibTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
|
parent::__construct();
|
||||||
|
|
||||||
//$this->sharedFixture
|
//$this->sharedFixture
|
||||||
global $conf,$user,$langs,$db;
|
global $conf,$user,$langs,$db;
|
||||||
$this->savconf=$conf;
|
$this->savconf=$conf;
|
||||||
@@ -179,32 +181,32 @@ class DateLibTest extends PHPUnit_Framework_TestCase
|
|||||||
$user=$this->savuser;
|
$user=$this->savuser;
|
||||||
$langs=$this->savlangs;
|
$langs=$this->savlangs;
|
||||||
$db=$this->savdb;
|
$db=$this->savdb;
|
||||||
|
|
||||||
// With same hours - Tuesday/Wednesday jan 2013
|
// With same hours - Tuesday/Wednesday jan 2013
|
||||||
$date1=dol_mktime(0, 0, 0, 1, 1, 2013);
|
$date1=dol_mktime(0, 0, 0, 1, 1, 2013);
|
||||||
$date2=dol_mktime(0, 0, 0, 1, 2, 2013);
|
$date2=dol_mktime(0, 0, 0, 1, 2, 2013);
|
||||||
|
|
||||||
$result=num_public_holiday($date1,$date2,'FR',1);
|
$result=num_public_holiday($date1,$date2,'FR',1);
|
||||||
print __METHOD__." result=".$result."\n";
|
print __METHOD__." result=".$result."\n";
|
||||||
$this->assertEquals(1,$result,'NumPublicHoliday for Tuesday/Wednesday jan 2013 for FR'); // 1 closed days
|
$this->assertEquals(1,$result,'NumPublicHoliday for Tuesday/Wednesday jan 2013 for FR'); // 1 closed days
|
||||||
|
|
||||||
$result=num_public_holiday($date1,$date2,'XX',1);
|
$result=num_public_holiday($date1,$date2,'XX',1);
|
||||||
print __METHOD__." result=".$result."\n";
|
print __METHOD__." result=".$result."\n";
|
||||||
$this->assertEquals(0,$result,'NumPublicHoliday for Tuesday/Wednesday jan 2013 for XX'); // no closed days (country unknown)
|
$this->assertEquals(0,$result,'NumPublicHoliday for Tuesday/Wednesday jan 2013 for XX'); // no closed days (country unknown)
|
||||||
|
|
||||||
// With same hours - Friday/Sunday jan 2013
|
// With same hours - Friday/Sunday jan 2013
|
||||||
$date1=dol_mktime(0, 0, 0, 1, 4, 2013);
|
$date1=dol_mktime(0, 0, 0, 1, 4, 2013);
|
||||||
$date2=dol_mktime(0, 0, 0, 1, 6, 2013);
|
$date2=dol_mktime(0, 0, 0, 1, 6, 2013);
|
||||||
|
|
||||||
$result=num_public_holiday($date1,$date2,'FR',1);
|
$result=num_public_holiday($date1,$date2,'FR',1);
|
||||||
print __METHOD__." result=".$result."\n";
|
print __METHOD__." result=".$result."\n";
|
||||||
$this->assertEquals(2,$result,'NumPublicHoliday for FR'); // 1 opened day, 2 closed days
|
$this->assertEquals(2,$result,'NumPublicHoliday for FR'); // 1 opened day, 2 closed days
|
||||||
|
|
||||||
$result=num_public_holiday($date1,$date2,'XX',1);
|
$result=num_public_holiday($date1,$date2,'XX',1);
|
||||||
print __METHOD__." result=".$result."\n";
|
print __METHOD__." result=".$result."\n";
|
||||||
$this->assertEquals(2,$result,'NumPublicHoliday for XX'); // 1 opened day, 2 closed days (even if country unknown)
|
$this->assertEquals(2,$result,'NumPublicHoliday for XX'); // 1 opened day, 2 closed days (even if country unknown)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testNumOpenDay
|
* testNumOpenDay
|
||||||
*
|
*
|
||||||
@@ -217,32 +219,32 @@ class DateLibTest extends PHPUnit_Framework_TestCase
|
|||||||
$user=$this->savuser;
|
$user=$this->savuser;
|
||||||
$langs=$this->savlangs;
|
$langs=$this->savlangs;
|
||||||
$db=$this->savdb;
|
$db=$this->savdb;
|
||||||
|
|
||||||
// With same hours - Tuesday/Wednesday jan 2013
|
// With same hours - Tuesday/Wednesday jan 2013
|
||||||
$date1=dol_mktime(0, 0, 0, 1, 1, 2013);
|
$date1=dol_mktime(0, 0, 0, 1, 1, 2013);
|
||||||
$date2=dol_mktime(0, 0, 0, 1, 2, 2013);
|
$date2=dol_mktime(0, 0, 0, 1, 2, 2013);
|
||||||
|
|
||||||
$result=num_open_day($date1,$date2,0,1,0,'FR');
|
$result=num_open_day($date1,$date2,0,1,0,'FR');
|
||||||
print __METHOD__." result=".$result."\n";
|
print __METHOD__." result=".$result."\n";
|
||||||
$this->assertEquals(1,$result,'NumOpenDay Tuesday/Wednesday jan 2013 for FR'); // 1 opened days
|
$this->assertEquals(1,$result,'NumOpenDay Tuesday/Wednesday jan 2013 for FR'); // 1 opened days
|
||||||
|
|
||||||
$result=num_open_day($date1,$date2,0,1,0,'XX');
|
$result=num_open_day($date1,$date2,0,1,0,'XX');
|
||||||
print __METHOD__." result=".$result."\n";
|
print __METHOD__." result=".$result."\n";
|
||||||
$this->assertEquals(2,$result,'NumOpenDay Tuesday/Wednesday jan 2013 for XX'); // 2 opened days (country unknown)
|
$this->assertEquals(2,$result,'NumOpenDay Tuesday/Wednesday jan 2013 for XX'); // 2 opened days (country unknown)
|
||||||
|
|
||||||
// With same hours - Friday/Sunday jan 2013
|
// With same hours - Friday/Sunday jan 2013
|
||||||
$date1=dol_mktime(0, 0, 0, 1, 4, 2013);
|
$date1=dol_mktime(0, 0, 0, 1, 4, 2013);
|
||||||
$date2=dol_mktime(0, 0, 0, 1, 6, 2013);
|
$date2=dol_mktime(0, 0, 0, 1, 6, 2013);
|
||||||
|
|
||||||
$result=num_open_day($date1,$date2,0,1,0,'FR');
|
$result=num_open_day($date1,$date2,0,1,0,'FR');
|
||||||
print __METHOD__." result=".$result."\n";
|
print __METHOD__." result=".$result."\n";
|
||||||
$this->assertEquals(1,$result,'NumOpenDay for FR'); // 1 opened day, 2 closed
|
$this->assertEquals(1,$result,'NumOpenDay for FR'); // 1 opened day, 2 closed
|
||||||
|
|
||||||
$result=num_open_day($date1,$date2,'XX',1);
|
$result=num_open_day($date1,$date2,'XX',1);
|
||||||
print __METHOD__." result=".$result."\n";
|
print __METHOD__." result=".$result."\n";
|
||||||
$this->assertEquals(1,$result,'NumOpenDay for XX'); // 1 opened day, 2 closes (even if country unknown)
|
$this->assertEquals(1,$result,'NumOpenDay for XX'); // 1 opened day, 2 closes (even if country unknown)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testConvertTime2Seconds
|
* testConvertTime2Seconds
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -60,6 +60,8 @@ class DateLibTzFranceTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
|
parent::__construct();
|
||||||
|
|
||||||
//$this->sharedFixture
|
//$this->sharedFixture
|
||||||
global $conf,$user,$langs,$db;
|
global $conf,$user,$langs,$db;
|
||||||
$this->savconf=$conf;
|
$this->savconf=$conf;
|
||||||
|
|||||||
@@ -60,6 +60,8 @@ class DiscountTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
|
parent::__construct();
|
||||||
|
|
||||||
//$this->sharedFixture
|
//$this->sharedFixture
|
||||||
global $conf,$user,$langs,$db;
|
global $conf,$user,$langs,$db;
|
||||||
$this->savconf=$conf;
|
$this->savconf=$conf;
|
||||||
|
|||||||
@@ -60,6 +60,8 @@ class EntrepotTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
|
parent::__construct();
|
||||||
|
|
||||||
//$this->sharedFixture
|
//$this->sharedFixture
|
||||||
global $conf,$user,$langs,$db;
|
global $conf,$user,$langs,$db;
|
||||||
$this->savconf=$conf;
|
$this->savconf=$conf;
|
||||||
|
|||||||
@@ -64,6 +64,8 @@ class ExportTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
|
parent::__construct();
|
||||||
|
|
||||||
//$this->sharedFixture
|
//$this->sharedFixture
|
||||||
global $conf,$user,$langs,$db;
|
global $conf,$user,$langs,$db;
|
||||||
$this->savconf=$conf;
|
$this->savconf=$conf;
|
||||||
|
|||||||
@@ -60,6 +60,8 @@ class FactureFournisseurTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
|
parent::__construct();
|
||||||
|
|
||||||
//$this->sharedFixture
|
//$this->sharedFixture
|
||||||
global $conf,$user,$langs,$db;
|
global $conf,$user,$langs,$db;
|
||||||
$this->savconf=$conf;
|
$this->savconf=$conf;
|
||||||
|
|||||||
@@ -61,6 +61,8 @@ class FactureRecTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
|
parent::__construct();
|
||||||
|
|
||||||
//$this->sharedFixture
|
//$this->sharedFixture
|
||||||
global $conf,$user,$langs,$db;
|
global $conf,$user,$langs,$db;
|
||||||
$this->savconf=$conf;
|
$this->savconf=$conf;
|
||||||
|
|||||||
@@ -59,7 +59,9 @@ class FactureTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
//$this->sharedFixture
|
parent::__construct();
|
||||||
|
|
||||||
|
//$this->sharedFixture
|
||||||
global $conf,$user,$langs,$db;
|
global $conf,$user,$langs,$db;
|
||||||
$this->savconf=$conf;
|
$this->savconf=$conf;
|
||||||
$this->savuser=$user;
|
$this->savuser=$user;
|
||||||
|
|||||||
@@ -60,6 +60,8 @@ class FactureTestRounding extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
|
parent::__construct();
|
||||||
|
|
||||||
//$this->sharedFixture
|
//$this->sharedFixture
|
||||||
global $conf,$user,$langs,$db;
|
global $conf,$user,$langs,$db;
|
||||||
$this->savconf=$conf;
|
$this->savconf=$conf;
|
||||||
|
|||||||
@@ -60,6 +60,8 @@ class FichinterTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
|
parent::__construct();
|
||||||
|
|
||||||
//$this->sharedFixture
|
//$this->sharedFixture
|
||||||
global $conf,$user,$langs,$db;
|
global $conf,$user,$langs,$db;
|
||||||
$this->savconf=$conf;
|
$this->savconf=$conf;
|
||||||
|
|||||||
@@ -61,6 +61,8 @@ class FilesLibTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
|
parent::__construct();
|
||||||
|
|
||||||
//$this->sharedFixture
|
//$this->sharedFixture
|
||||||
global $conf,$user,$langs,$db;
|
global $conf,$user,$langs,$db;
|
||||||
$this->savconf=$conf;
|
$this->savconf=$conf;
|
||||||
@@ -399,7 +401,7 @@ class FilesLibTest extends PHPUnit_Framework_TestCase
|
|||||||
print __METHOD__." result=".join(',',$result)."\n";
|
print __METHOD__." result=".join(',',$result)."\n";
|
||||||
$this->assertEquals(0,count($result));
|
$this->assertEquals(0,count($result));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testDolDirList
|
* testDolDirList
|
||||||
*
|
*
|
||||||
@@ -411,7 +413,7 @@ class FilesLibTest extends PHPUnit_Framework_TestCase
|
|||||||
public function testDolDirList()
|
public function testDolDirList()
|
||||||
{
|
{
|
||||||
global $conf,$user,$langs,$db;
|
global $conf,$user,$langs,$db;
|
||||||
|
|
||||||
// Scan dir to guaruante we on't have library jquery twice (we accept exception of duplicte into ckeditor because all dir is removed for debian package, so there is no duplicate).
|
// Scan dir to guaruante we on't have library jquery twice (we accept exception of duplicte into ckeditor because all dir is removed for debian package, so there is no duplicate).
|
||||||
$founddirs=dol_dir_list(DOL_DOCUMENT_ROOT.'/includes/', 'files', 1, '^jquery\.js', array('ckeditor'));
|
$founddirs=dol_dir_list(DOL_DOCUMENT_ROOT.'/includes/', 'files', 1, '^jquery\.js', array('ckeditor'));
|
||||||
print __METHOD__." count(founddirs)=".count($founddirs)."\n";
|
print __METHOD__." count(founddirs)=".count($founddirs)."\n";
|
||||||
|
|||||||
@@ -60,6 +60,8 @@ class FormAdminTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
|
parent::__construct();
|
||||||
|
|
||||||
//$this->sharedFixture
|
//$this->sharedFixture
|
||||||
global $conf,$user,$langs,$db;
|
global $conf,$user,$langs,$db;
|
||||||
$this->savconf=$conf;
|
$this->savconf=$conf;
|
||||||
|
|||||||
@@ -63,7 +63,9 @@ class Functions2LibTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
//$this->sharedFixture
|
parent::__construct();
|
||||||
|
|
||||||
|
//$this->sharedFixture
|
||||||
global $conf,$user,$langs,$db;
|
global $conf,$user,$langs,$db;
|
||||||
$this->savconf=$conf;
|
$this->savconf=$conf;
|
||||||
$this->savuser=$user;
|
$this->savuser=$user;
|
||||||
|
|||||||
@@ -63,7 +63,9 @@ class FunctionsLibTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
//$this->sharedFixture
|
parent::__construct();
|
||||||
|
|
||||||
|
//$this->sharedFixture
|
||||||
global $conf,$user,$langs,$db;
|
global $conf,$user,$langs,$db;
|
||||||
$this->savconf=$conf;
|
$this->savconf=$conf;
|
||||||
$this->savuser=$user;
|
$this->savuser=$user;
|
||||||
@@ -130,21 +132,21 @@ class FunctionsLibTest extends PHPUnit_Framework_TestCase
|
|||||||
/*$tmp=dol_buildpath('/google/oauth2callback.php', 0);
|
/*$tmp=dol_buildpath('/google/oauth2callback.php', 0);
|
||||||
var_dump($tmp);
|
var_dump($tmp);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*$tmp=dol_buildpath('/google/oauth2callback.php', 1);
|
/*$tmp=dol_buildpath('/google/oauth2callback.php', 1);
|
||||||
var_dump($tmp);
|
var_dump($tmp);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$result=dol_buildpath('/google/oauth2callback.php', 2);
|
$result=dol_buildpath('/google/oauth2callback.php', 2);
|
||||||
print __METHOD__." result=".$result."\n";
|
print __METHOD__." result=".$result."\n";
|
||||||
$this->assertStringStartsWith('http', $result);
|
$this->assertStringStartsWith('http', $result);
|
||||||
|
|
||||||
$result=dol_buildpath('/google/oauth2callback.php', 3);
|
$result=dol_buildpath('/google/oauth2callback.php', 3);
|
||||||
print __METHOD__." result=".$result."\n";
|
print __METHOD__." result=".$result."\n";
|
||||||
$this->assertStringStartsWith('http', $result);
|
$this->assertStringStartsWith('http', $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testGetBrowserInfo
|
* testGetBrowserInfo
|
||||||
*
|
*
|
||||||
@@ -999,5 +1001,5 @@ class FunctionsLibTest extends PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,6 +62,8 @@ class HolidayTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
|
parent::__construct();
|
||||||
|
|
||||||
//$this->sharedFixture
|
//$this->sharedFixture
|
||||||
global $conf,$user,$langs,$db;
|
global $conf,$user,$langs,$db;
|
||||||
$this->savconf=$conf;
|
$this->savconf=$conf;
|
||||||
@@ -201,11 +203,11 @@ class HolidayTest extends PHPUnit_Framework_TestCase
|
|||||||
$localobject->email='newemail@newemail.com';
|
$localobject->email='newemail@newemail.com';
|
||||||
$localobject->jabberid='New im id';
|
$localobject->jabberid='New im id';
|
||||||
$localobject->default_lang='es_ES';
|
$localobject->default_lang='es_ES';
|
||||||
|
|
||||||
$result=$localobject->update($localobject->id,$user);
|
$result=$localobject->update($localobject->id,$user);
|
||||||
print __METHOD__." id=".$localobject->id." result=".$result."\n";
|
print __METHOD__." id=".$localobject->id." result=".$result."\n";
|
||||||
$this->assertLessThan($result, 0, 'Holiday::update error');
|
$this->assertLessThan($result, 0, 'Holiday::update error');
|
||||||
|
|
||||||
$result=$localobject->update_note($localobject->note_private,'_private');
|
$result=$localobject->update_note($localobject->note_private,'_private');
|
||||||
print __METHOD__." id=".$localobject->id." result=".$result."\n";
|
print __METHOD__." id=".$localobject->id." result=".$result."\n";
|
||||||
$this->assertLessThan($result, 0, 'Holiday::update_note (private) error');
|
$this->assertLessThan($result, 0, 'Holiday::update_note (private) error');
|
||||||
@@ -213,7 +215,7 @@ class HolidayTest extends PHPUnit_Framework_TestCase
|
|||||||
$result=$localobject->update_note($localobject->note_public, '_public');
|
$result=$localobject->update_note($localobject->note_public, '_public');
|
||||||
print __METHOD__." id=".$localobject->id." result=".$result."\n";
|
print __METHOD__." id=".$localobject->id." result=".$result."\n";
|
||||||
$this->assertLessThan($result, 0, 'Holiday::update_note (public) error');
|
$this->assertLessThan($result, 0, 'Holiday::update_note (public) error');
|
||||||
|
|
||||||
|
|
||||||
$newobject=new Holiday($this->savdb);
|
$newobject=new Holiday($this->savdb);
|
||||||
$result=$newobject->fetch($localobject->id);
|
$result=$newobject->fetch($localobject->id);
|
||||||
|
|||||||
@@ -61,6 +61,8 @@ class ImagesLibTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
|
parent::__construct();
|
||||||
|
|
||||||
//$this->sharedFixture
|
//$this->sharedFixture
|
||||||
global $conf,$user,$langs,$db;
|
global $conf,$user,$langs,$db;
|
||||||
$this->savconf=$conf;
|
$this->savconf=$conf;
|
||||||
|
|||||||
@@ -62,6 +62,8 @@ class ImportTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
|
parent::__construct();
|
||||||
|
|
||||||
//$this->sharedFixture
|
//$this->sharedFixture
|
||||||
global $conf,$user,$langs,$db;
|
global $conf,$user,$langs,$db;
|
||||||
$this->savconf=$conf;
|
$this->savconf=$conf;
|
||||||
|
|||||||
@@ -62,7 +62,9 @@ class JsonLibTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
//$this->sharedFixture
|
parent::__construct();
|
||||||
|
|
||||||
|
//$this->sharedFixture
|
||||||
global $conf,$user,$langs,$db;
|
global $conf,$user,$langs,$db;
|
||||||
$this->savconf=$conf;
|
$this->savconf=$conf;
|
||||||
$this->savuser=$user;
|
$this->savuser=$user;
|
||||||
@@ -134,7 +136,7 @@ class JsonLibTest extends PHPUnit_Framework_TestCase
|
|||||||
// Do a test with an array starting with 0
|
// Do a test with an array starting with 0
|
||||||
$arraytotest=array(0=>array('key'=>1,'value'=>'PRODREF','label'=>'Product ref with é and special chars \\ \' "'));
|
$arraytotest=array(0=>array('key'=>1,'value'=>'PRODREF','label'=>'Product ref with é and special chars \\ \' "'));
|
||||||
$arrayencodedexpected='[{"key":1,"value":"PRODREF","label":"Product ref with \u00e9 and special chars \\\\ \' \""}]';
|
$arrayencodedexpected='[{"key":1,"value":"PRODREF","label":"Product ref with \u00e9 and special chars \\\\ \' \""}]';
|
||||||
|
|
||||||
$encoded=json_encode($arraytotest);
|
$encoded=json_encode($arraytotest);
|
||||||
$this->assertEquals($arrayencodedexpected,$encoded);
|
$this->assertEquals($arrayencodedexpected,$encoded);
|
||||||
$decoded=json_decode($encoded,true);
|
$decoded=json_decode($encoded,true);
|
||||||
@@ -148,7 +150,7 @@ class JsonLibTest extends PHPUnit_Framework_TestCase
|
|||||||
// Same test but array start with 2 instead of 0
|
// Same test but array start with 2 instead of 0
|
||||||
$arraytotest=array(2=>array('key'=>1,'value'=>'PRODREF','label'=>'Product ref with é and special chars \\ \' "'));
|
$arraytotest=array(2=>array('key'=>1,'value'=>'PRODREF','label'=>'Product ref with é and special chars \\ \' "'));
|
||||||
$arrayencodedexpected='{"2":{"key":1,"value":"PRODREF","label":"Product ref with \u00e9 and special chars \\\\ \' \""}}';
|
$arrayencodedexpected='{"2":{"key":1,"value":"PRODREF","label":"Product ref with \u00e9 and special chars \\\\ \' \""}}';
|
||||||
|
|
||||||
$encoded=json_encode($arraytotest);
|
$encoded=json_encode($arraytotest);
|
||||||
$this->assertEquals($arrayencodedexpected,$encoded);
|
$this->assertEquals($arrayencodedexpected,$encoded);
|
||||||
$decoded=json_decode($encoded,true);
|
$decoded=json_decode($encoded,true);
|
||||||
@@ -158,7 +160,7 @@ class JsonLibTest extends PHPUnit_Framework_TestCase
|
|||||||
$this->assertEquals($arrayencodedexpected,$encoded);
|
$this->assertEquals($arrayencodedexpected,$encoded);
|
||||||
$decoded=dol_json_decode($encoded,true);
|
$decoded=dol_json_decode($encoded,true);
|
||||||
$this->assertEquals($arraytotest,$decoded,'test for dol_json_xxx');
|
$this->assertEquals($arraytotest,$decoded,'test for dol_json_xxx');
|
||||||
|
|
||||||
// Test with object
|
// Test with object
|
||||||
$now=gmmktime(12,0,0,1,1,1970);
|
$now=gmmktime(12,0,0,1,1,1970);
|
||||||
$objecttotest=new stdClass();
|
$objecttotest=new stdClass();
|
||||||
|
|||||||
@@ -72,6 +72,8 @@ class LangTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
|
parent::__construct();
|
||||||
|
|
||||||
//$this->sharedFixture
|
//$this->sharedFixture
|
||||||
global $conf,$user,$langs,$db;
|
global $conf,$user,$langs,$db;
|
||||||
$this->savconf=$conf;
|
$this->savconf=$conf;
|
||||||
|
|||||||
@@ -60,6 +60,8 @@ class MarginsLibTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
|
parent::__construct();
|
||||||
|
|
||||||
//$this->sharedFixture
|
//$this->sharedFixture
|
||||||
global $conf,$user,$langs,$db;
|
global $conf,$user,$langs,$db;
|
||||||
$this->savconf=$conf;
|
$this->savconf=$conf;
|
||||||
@@ -136,16 +138,15 @@ class MarginsLibTest extends PHPUnit_Framework_TestCase
|
|||||||
$this->assertEquals(25,$result[1]);
|
$this->assertEquals(25,$result[1]);
|
||||||
print __METHOD__." result[2]=".$result[2]."\n";
|
print __METHOD__." result[2]=".$result[2]."\n";
|
||||||
$this->assertEquals(20,$result[2]);
|
$this->assertEquals(20,$result[2]);
|
||||||
|
|
||||||
$result=getMarginInfos(10, 10, 19.6, 0, 0, 0, 8);
|
$result=getMarginInfos(10, 10, 19.6, 0, 0, 0, 8);
|
||||||
var_dump($result);
|
|
||||||
print __METHOD__." result[0]=".$result[0]."\n";
|
print __METHOD__." result[0]=".$result[0]."\n";
|
||||||
$this->assertEquals(8,$result[0]);
|
$this->assertEquals(8,$result[0]);
|
||||||
print __METHOD__." result[1]=".$result[1]."\n";
|
print __METHOD__." result[1]=".$result[1]."\n";
|
||||||
$this->assertEquals(12.5,$result[1]);
|
$this->assertEquals(12.5,$result[1]);
|
||||||
print __METHOD__." result[2]=".$result[2]."\n";
|
print __METHOD__." result[2]=".$result[2]."\n";
|
||||||
$this->assertEquals(1/9*100,$result[2]);
|
$this->assertEquals(1/9*100,$result[2]);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -59,6 +59,8 @@ class ModulesTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
|
parent::__construct();
|
||||||
|
|
||||||
//$this->sharedFixture
|
//$this->sharedFixture
|
||||||
global $conf,$user,$langs,$db;
|
global $conf,$user,$langs,$db;
|
||||||
$this->savconf=$conf;
|
$this->savconf=$conf;
|
||||||
|
|||||||
@@ -62,6 +62,8 @@ class MouvementStockTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
|
parent::__construct();
|
||||||
|
|
||||||
//$this->sharedFixture
|
//$this->sharedFixture
|
||||||
global $conf,$user,$langs,$db;
|
global $conf,$user,$langs,$db;
|
||||||
$this->savconf=$conf;
|
$this->savconf=$conf;
|
||||||
|
|||||||
@@ -59,6 +59,8 @@ class NumberingModulesTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
|
parent::__construct();
|
||||||
|
|
||||||
//$this->sharedFixture
|
//$this->sharedFixture
|
||||||
global $conf,$user,$langs,$db;
|
global $conf,$user,$langs,$db;
|
||||||
$this->savconf=$conf;
|
$this->savconf=$conf;
|
||||||
@@ -75,7 +77,7 @@ class NumberingModulesTest extends PHPUnit_Framework_TestCase
|
|||||||
public static function setUpBeforeClass()
|
public static function setUpBeforeClass()
|
||||||
{
|
{
|
||||||
global $conf,$user,$langs,$db;
|
global $conf,$user,$langs,$db;
|
||||||
|
|
||||||
$db->begin(); // This is to have all actions inside a transaction even if test launched without suite.
|
$db->begin(); // This is to have all actions inside a transaction even if test launched without suite.
|
||||||
|
|
||||||
print __METHOD__."\n";
|
print __METHOD__."\n";
|
||||||
@@ -138,7 +140,7 @@ class NumberingModulesTest extends PHPUnit_Framework_TestCase
|
|||||||
$conf->global->FACTURE_MERCURE_MASK_CREDIT='{yyyy}-{0000}';
|
$conf->global->FACTURE_MERCURE_MASK_CREDIT='{yyyy}-{0000}';
|
||||||
$conf->global->FACTURE_MERCURE_MASK_INVOICE='{yyyy}-{0000}';
|
$conf->global->FACTURE_MERCURE_MASK_INVOICE='{yyyy}-{0000}';
|
||||||
$conf->global->INVOICE_CAN_ALWAYS_BE_REMOVED=0;
|
$conf->global->INVOICE_CAN_ALWAYS_BE_REMOVED=0;
|
||||||
|
|
||||||
$localobject=new Facture($this->savdb);
|
$localobject=new Facture($this->savdb);
|
||||||
$localobject->initAsSpecimen();
|
$localobject->initAsSpecimen();
|
||||||
$localobject->date=dol_mktime(12, 0, 0, 1, 1, 1915); // we use year 1915 to be sure to not have existing invoice for this year
|
$localobject->date=dol_mktime(12, 0, 0, 1, 1, 1915); // we use year 1915 to be sure to not have existing invoice for this year
|
||||||
|
|||||||
@@ -61,6 +61,8 @@ class PaypalTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
|
parent::__construct();
|
||||||
|
|
||||||
//$this->sharedFixture
|
//$this->sharedFixture
|
||||||
global $conf,$user,$langs,$db;
|
global $conf,$user,$langs,$db;
|
||||||
$this->savconf=$conf;
|
$this->savconf=$conf;
|
||||||
@@ -135,9 +137,9 @@ class PaypalTest extends PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
$urltotest=getPaypalPaymentUrl(1,'free');
|
$urltotest=getPaypalPaymentUrl(1,'free');
|
||||||
print "urltotest=".$urltotest."\n";
|
print "urltotest=".$urltotest."\n";
|
||||||
|
|
||||||
$result=getURLContent($urltotest, 'GET');
|
$result=getURLContent($urltotest, 'GET');
|
||||||
|
|
||||||
print __METHOD__." result=".$result."\n";
|
print __METHOD__." result=".$result."\n";
|
||||||
$this->assertLessThanOrEqual($result, 0);
|
$this->assertLessThanOrEqual($result, 0);
|
||||||
|
|
||||||
|
|||||||
@@ -63,6 +63,8 @@ class PdfDocTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
|
parent::__construct();
|
||||||
|
|
||||||
//$this->sharedFixture
|
//$this->sharedFixture
|
||||||
global $conf,$user,$langs,$db;
|
global $conf,$user,$langs,$db;
|
||||||
$this->savconf=$conf;
|
$this->savconf=$conf;
|
||||||
|
|||||||
@@ -62,6 +62,8 @@ class PgsqlTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
|
parent::__construct();
|
||||||
|
|
||||||
//$this->sharedFixture
|
//$this->sharedFixture
|
||||||
global $conf,$user,$langs,$db;
|
global $conf,$user,$langs,$db;
|
||||||
$this->savconf=$conf;
|
$this->savconf=$conf;
|
||||||
@@ -167,13 +169,13 @@ class PgsqlTest extends PHPUnit_Framework_TestCase
|
|||||||
$result=DoliDBPgsql::convertSQLFromMysql($sql);
|
$result=DoliDBPgsql::convertSQLFromMysql($sql);
|
||||||
print __METHOD__." result=".$result."\n";
|
print __METHOD__." result=".$result."\n";
|
||||||
$this->assertEquals($result, "SELECT a.b, STRING_AGG(a.c, ',') FROM table GROUP BY a.b", 'Test GROUP_CONCAT (without SEPARATOR)');
|
$this->assertEquals($result, "SELECT a.b, STRING_AGG(a.c, ',') FROM table GROUP BY a.b", 'Test GROUP_CONCAT (without SEPARATOR)');
|
||||||
|
|
||||||
// Test GROUP_CONCAT (with SEPARATOR)
|
// Test GROUP_CONCAT (with SEPARATOR)
|
||||||
$sql="SELECT a.b, GROUP_CONCAT(a.c SEPARATOR ',') FROM table GROUP BY a.b";
|
$sql="SELECT a.b, GROUP_CONCAT(a.c SEPARATOR ',') FROM table GROUP BY a.b";
|
||||||
$result=DoliDBPgsql::convertSQLFromMysql($sql);
|
$result=DoliDBPgsql::convertSQLFromMysql($sql);
|
||||||
print __METHOD__." result=".$result."\n";
|
print __METHOD__." result=".$result."\n";
|
||||||
$this->assertEquals($result, "SELECT a.b, STRING_AGG(a.c, ',') FROM table GROUP BY a.b", 'Test GROUP_CONCAT (with SEPARATOR)');
|
$this->assertEquals($result, "SELECT a.b, STRING_AGG(a.c, ',') FROM table GROUP BY a.b", 'Test GROUP_CONCAT (with SEPARATOR)');
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -67,7 +67,9 @@ class PricesTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
//$this->sharedFixture
|
parent::__construct();
|
||||||
|
|
||||||
|
//$this->sharedFixture
|
||||||
global $conf,$user,$langs,$db;
|
global $conf,$user,$langs,$db;
|
||||||
$this->savconf=$conf;
|
$this->savconf=$conf;
|
||||||
$this->savuser=$user;
|
$this->savuser=$user;
|
||||||
@@ -160,8 +162,8 @@ class PricesTest extends PHPUnit_Framework_TestCase
|
|||||||
print __METHOD__." result1=".join(', ',$result1)."\n";
|
print __METHOD__." result1=".join(', ',$result1)."\n";
|
||||||
// result[0,1,2,3,4,5,6,7,8] (total_ht, total_vat, total_ttc, pu_ht, pu_tva, pu_ttc, total_ht_without_discount, total_vat_without_discount, total_ttc_without_discount)
|
// result[0,1,2,3,4,5,6,7,8] (total_ht, total_vat, total_ttc, pu_ht, pu_tva, pu_ttc, total_ht_without_discount, total_vat_without_discount, total_ttc_without_discount)
|
||||||
$this->assertEquals(array(17.12, 1.71, 18.83, 8.56, 0.856, 9.416, 17.12, 1.71, 18.83, 0, 0, 0, 0, 0, 0, 0, 18.7, 1.87, 20.56),$result1,'Test1 FR');
|
$this->assertEquals(array(17.12, 1.71, 18.83, 8.56, 0.856, 9.416, 17.12, 1.71, 18.83, 0, 0, 0, 0, 0, 0, 0, 18.7, 1.87, 20.56),$result1,'Test1 FR');
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Country Spain
|
* Country Spain
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -60,7 +60,9 @@ class ProductTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
//$this->sharedFixture
|
parent::__construct();
|
||||||
|
|
||||||
|
//$this->sharedFixture
|
||||||
global $conf,$user,$langs,$db;
|
global $conf,$user,$langs,$db;
|
||||||
$this->savconf=$conf;
|
$this->savconf=$conf;
|
||||||
$this->savuser=$user;
|
$this->savuser=$user;
|
||||||
|
|||||||
@@ -61,6 +61,8 @@ class ProjectTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
|
parent::__construct();
|
||||||
|
|
||||||
//$this->sharedFixture
|
//$this->sharedFixture
|
||||||
global $conf,$user,$langs,$db;
|
global $conf,$user,$langs,$db;
|
||||||
$this->savconf=$conf;
|
$this->savconf=$conf;
|
||||||
|
|||||||
@@ -60,6 +60,8 @@ class PropalTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
|
parent::__construct();
|
||||||
|
|
||||||
//$this->sharedFixture
|
//$this->sharedFixture
|
||||||
global $conf,$user,$langs,$db;
|
global $conf,$user,$langs,$db;
|
||||||
$this->savconf=$conf;
|
$this->savconf=$conf;
|
||||||
|
|||||||
@@ -64,7 +64,9 @@ class RestAPIUserTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
//$this->sharedFixture
|
parent::__construct();
|
||||||
|
|
||||||
|
//$this->sharedFixture
|
||||||
global $conf,$user,$langs,$db;
|
global $conf,$user,$langs,$db;
|
||||||
$this->savconf=$conf;
|
$this->savconf=$conf;
|
||||||
$this->savuser=$user;
|
$this->savuser=$user;
|
||||||
@@ -106,7 +108,7 @@ class RestAPIUserTest extends PHPUnit_Framework_TestCase
|
|||||||
$user=$this->savuser;
|
$user=$this->savuser;
|
||||||
$langs=$this->savlangs;
|
$langs=$this->savlangs;
|
||||||
$db=$this->savdb;
|
$db=$this->savdb;
|
||||||
|
|
||||||
$this->api_url=DOL_MAIN_URL_ROOT.'/api/index.php';
|
$this->api_url=DOL_MAIN_URL_ROOT.'/api/index.php';
|
||||||
|
|
||||||
$login='admin';
|
$login='admin';
|
||||||
@@ -149,7 +151,7 @@ class RestAPIUserTest extends PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
$url = $this->api_url.'/user/123456789?api_key='.$this->api_key;
|
$url = $this->api_url.'/user/123456789?api_key='.$this->api_key;
|
||||||
//$addheaders=array('Content-Type: application/json');
|
//$addheaders=array('Content-Type: application/json');
|
||||||
|
|
||||||
print __METHOD__." Request url=".$url."\n";
|
print __METHOD__." Request url=".$url."\n";
|
||||||
$result=getURLContent($url, 'GET', '', 1, array());
|
$result=getURLContent($url, 'GET', '', 1, array());
|
||||||
//print __METHOD__." Result for unexisting user: ".var_export($result, true)."\n";
|
//print __METHOD__." Result for unexisting user: ".var_export($result, true)."\n";
|
||||||
@@ -158,7 +160,7 @@ class RestAPIUserTest extends PHPUnit_Framework_TestCase
|
|||||||
$object=json_decode($result['content'], true);
|
$object=json_decode($result['content'], true);
|
||||||
$this->assertNotNull($object, "Parsing of json result must no be null");
|
$this->assertNotNull($object, "Parsing of json result must no be null");
|
||||||
$this->assertEquals(404, $object['error']['code']);
|
$this->assertEquals(404, $object['error']['code']);
|
||||||
|
|
||||||
$url = $this->api_url.'/user/1?api_key='.$this->api_key;
|
$url = $this->api_url.'/user/1?api_key='.$this->api_key;
|
||||||
|
|
||||||
print __METHOD__." Request url=".$url."\n";
|
print __METHOD__." Request url=".$url."\n";
|
||||||
@@ -172,18 +174,18 @@ class RestAPIUserTest extends PHPUnit_Framework_TestCase
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function testRestCreateUser() {
|
public function testRestCreateUser() {
|
||||||
|
|
||||||
// attemp to create without mandatory fields :
|
// attemp to create without mandatory fields :
|
||||||
$url = $this->api_url.'/user?api_key='.$this->api_key;
|
$url = $this->api_url.'/user?api_key='.$this->api_key;
|
||||||
$addheaders=array('Content-Type: application/json');
|
$addheaders=array('Content-Type: application/json');
|
||||||
|
|
||||||
$bodyobj = array(
|
$bodyobj = array(
|
||||||
"lastname"=>"testRestUser",
|
"lastname"=>"testRestUser",
|
||||||
"password"=>"testRestPassword",
|
"password"=>"testRestPassword",
|
||||||
"email"=>"test@restuser.com"
|
"email"=>"test@restuser.com"
|
||||||
);
|
);
|
||||||
$body = json_encode($bodyobj);
|
$body = json_encode($bodyobj);
|
||||||
|
|
||||||
print __METHOD__." Request url=".$url."\n";
|
print __METHOD__." Request url=".$url."\n";
|
||||||
$result=getURLContent($url, 'POST', $body, 1, $addheaders);
|
$result=getURLContent($url, 'POST', $body, 1, $addheaders);
|
||||||
//print __METHOD__." Result for creating incomplete user".var_export($result, true)."\n";
|
//print __METHOD__." Result for creating incomplete user".var_export($result, true)."\n";
|
||||||
@@ -207,17 +209,17 @@ class RestAPIUserTest extends PHPUnit_Framework_TestCase
|
|||||||
print __METHOD__." Result code for creating user ".var_export($result, true)."\n";
|
print __METHOD__." Result code for creating user ".var_export($result, true)."\n";
|
||||||
print __METHOD__." curl_error_no: ".$result['curl_error_no']."\n";
|
print __METHOD__." curl_error_no: ".$result['curl_error_no']."\n";
|
||||||
$this->assertEquals($result['curl_error_no'],'');
|
$this->assertEquals($result['curl_error_no'],'');
|
||||||
$object=json_decode($result['content'], true);
|
$object=json_decode($result['content'], true);
|
||||||
$this->assertNotNull($object, "Parsing of json result must no be null");
|
$this->assertNotNull($object, "Parsing of json result must no be null");
|
||||||
$this->assertGreaterThan(0, $object['id'], $object['error']['code'].' '.$object['error']['message']);
|
$this->assertGreaterThan(0, $object['id'], $object['error']['code'].' '.$object['error']['message']);
|
||||||
|
|
||||||
// attempt to create duplicated user
|
// attempt to create duplicated user
|
||||||
print __METHOD__." Request url=".$url."\n";
|
print __METHOD__." Request url=".$url."\n";
|
||||||
$result=getURLContent($url, 'POST', $body, 1, $addheaders);
|
$result=getURLContent($url, 'POST', $body, 1, $addheaders);
|
||||||
//print __METHOD__." Result for creating duplicate user".var_export($result, true)."\n";
|
//print __METHOD__." Result for creating duplicate user".var_export($result, true)."\n";
|
||||||
print __METHOD__." curl_error_no: ".$result['curl_error_no']."\n";
|
print __METHOD__." curl_error_no: ".$result['curl_error_no']."\n";
|
||||||
$this->assertEquals($result['curl_error_no'],'');
|
$this->assertEquals($result['curl_error_no'],'');
|
||||||
$object=json_decode($result['content'], true);
|
$object=json_decode($result['content'], true);
|
||||||
$this->assertNotNull($object, "Parsing of json result must no be null");
|
$this->assertNotNull($object, "Parsing of json result must no be null");
|
||||||
$this->assertEquals(500, $object['error']['code'], $object['error']['code'].' '.$object['error']['message']);
|
$this->assertEquals(500, $object['error']['code'], $object['error']['code'].' '.$object['error']['message']);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -72,6 +72,8 @@ class ScriptsTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
|
parent::__construct();
|
||||||
|
|
||||||
//$this->sharedFixture
|
//$this->sharedFixture
|
||||||
global $conf,$user,$langs,$db;
|
global $conf,$user,$langs,$db;
|
||||||
$this->savconf=$conf;
|
$this->savconf=$conf;
|
||||||
|
|||||||
@@ -72,6 +72,8 @@ class SecurityTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
|
parent::__construct();
|
||||||
|
|
||||||
//$this->sharedFixture
|
//$this->sharedFixture
|
||||||
global $conf,$user,$langs,$db;
|
global $conf,$user,$langs,$db;
|
||||||
$this->savconf=$conf;
|
$this->savconf=$conf;
|
||||||
|
|||||||
@@ -60,7 +60,9 @@ class SocieteTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
//$this->sharedFixture
|
parent::__construct();
|
||||||
|
|
||||||
|
//$this->sharedFixture
|
||||||
global $conf,$user,$langs,$db;
|
global $conf,$user,$langs,$db;
|
||||||
$this->savconf=$conf;
|
$this->savconf=$conf;
|
||||||
$this->savuser=$user;
|
$this->savuser=$user;
|
||||||
|
|||||||
@@ -72,7 +72,9 @@ class SqlTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
//$this->sharedFixture
|
parent::__construct();
|
||||||
|
|
||||||
|
//$this->sharedFixture
|
||||||
global $conf,$user,$langs,$db;
|
global $conf,$user,$langs,$db;
|
||||||
$this->savconf=$conf;
|
$this->savconf=$conf;
|
||||||
$this->savuser=$user;
|
$this->savuser=$user;
|
||||||
@@ -143,16 +145,16 @@ class SqlTest extends PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
$listofsqldir = array(DOL_DOCUMENT_ROOT.'/install/mysql/tables', DOL_DOCUMENT_ROOT.'/install/mysql/migration');
|
$listofsqldir = array(DOL_DOCUMENT_ROOT.'/install/mysql/tables', DOL_DOCUMENT_ROOT.'/install/mysql/migration');
|
||||||
|
|
||||||
foreach ($listofsqldir as $dir)
|
foreach ($listofsqldir as $dir)
|
||||||
{
|
{
|
||||||
print 'Process dir '.$dir."\n";
|
print 'Process dir '.$dir."\n";
|
||||||
$filesarray = scandir($dir);
|
$filesarray = scandir($dir);
|
||||||
|
|
||||||
foreach($filesarray as $key => $file)
|
foreach($filesarray as $key => $file)
|
||||||
{
|
{
|
||||||
if (! preg_match('/\.sql$/',$file))
|
if (! preg_match('/\.sql$/',$file))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
print 'Check sql file '.$file."\n";
|
print 'Check sql file '.$file."\n";
|
||||||
$filecontent=file_get_contents($dir.'/'.$file);
|
$filecontent=file_get_contents($dir.'/'.$file);
|
||||||
|
|
||||||
@@ -167,7 +169,7 @@ class SqlTest extends PHPUnit_Framework_TestCase
|
|||||||
$result=strpos($filecontent,'ON DELETE CASCADE');
|
$result=strpos($filecontent,'ON DELETE CASCADE');
|
||||||
print __METHOD__." Result for checking we don't have 'ON DELETE CASCADE' = ".$result."\n";
|
print __METHOD__." Result for checking we don't have 'ON DELETE CASCADE' = ".$result."\n";
|
||||||
$this->assertTrue($result===false, 'Found ON DELETE CASCADE into '.$file.'. Bad.');
|
$this->assertTrue($result===false, 'Found ON DELETE CASCADE into '.$file.'. Bad.');
|
||||||
|
|
||||||
if ($dir == DOL_DOCUMENT_ROOT.'/install/mysql/migration')
|
if ($dir == DOL_DOCUMENT_ROOT.'/install/mysql/migration')
|
||||||
{
|
{
|
||||||
// Test for migration files only
|
// Test for migration files only
|
||||||
@@ -176,9 +178,9 @@ class SqlTest extends PHPUnit_Framework_TestCase
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (preg_match('/\.key\.sql$/',$file))
|
if (preg_match('/\.key\.sql$/',$file))
|
||||||
{
|
{
|
||||||
// Test for files key files only
|
// Test for files key files only
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -59,7 +59,9 @@ class UserGroupTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
//$this->sharedFixture
|
parent::__construct();
|
||||||
|
|
||||||
|
//$this->sharedFixture
|
||||||
global $conf,$user,$langs,$db;
|
global $conf,$user,$langs,$db;
|
||||||
$this->savconf=$conf;
|
$this->savconf=$conf;
|
||||||
$this->savuser=$user;
|
$this->savuser=$user;
|
||||||
@@ -117,7 +119,7 @@ class UserGroupTest extends PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* testUserGroupCreate
|
* testUserGroupCreate
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function testUserGroupCreate()
|
public function testUserGroupCreate()
|
||||||
@@ -139,7 +141,7 @@ class UserGroupTest extends PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* testUserGroupFetch
|
* testUserGroupFetch
|
||||||
*
|
*
|
||||||
* @param int $id Id of group
|
* @param int $id Id of group
|
||||||
* @return void
|
* @return void
|
||||||
* @depends testUserGroupCreate
|
* @depends testUserGroupCreate
|
||||||
@@ -163,7 +165,7 @@ class UserGroupTest extends PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* testUserGroupUpdate
|
* testUserGroupUpdate
|
||||||
*
|
*
|
||||||
* @param Object $localobject Group
|
* @param Object $localobject Group
|
||||||
* @return void
|
* @return void
|
||||||
* @depends testUserGroupFetch
|
* @depends testUserGroupFetch
|
||||||
@@ -187,7 +189,7 @@ class UserGroupTest extends PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* testUserGroupAddRight
|
* testUserGroupAddRight
|
||||||
*
|
*
|
||||||
* @param Object $localobject Object to show
|
* @param Object $localobject Object to show
|
||||||
* @return void
|
* @return void
|
||||||
* @depends testUserGroupUpdate
|
* @depends testUserGroupUpdate
|
||||||
@@ -210,7 +212,7 @@ class UserGroupTest extends PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* testUserGroupDelRight
|
* testUserGroupDelRight
|
||||||
*
|
*
|
||||||
* @param Object $localobject Object
|
* @param Object $localobject Object
|
||||||
* @return void
|
* @return void
|
||||||
* @depends testUserGroupAddRight
|
* @depends testUserGroupAddRight
|
||||||
@@ -233,7 +235,7 @@ class UserGroupTest extends PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* testUserGroupOther
|
* testUserGroupOther
|
||||||
*
|
*
|
||||||
* @param Object $localobject Object
|
* @param Object $localobject Object
|
||||||
* @return void
|
* @return void
|
||||||
* @depends testUserGroupDelRight
|
* @depends testUserGroupDelRight
|
||||||
@@ -261,7 +263,7 @@ class UserGroupTest extends PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* testUserGroupDelete
|
* testUserGroupDelete
|
||||||
*
|
*
|
||||||
* @param int $id Id of object
|
* @param int $id Id of object
|
||||||
* @return void
|
* @return void
|
||||||
* @depends testUserGroupOther
|
* @depends testUserGroupOther
|
||||||
|
|||||||
@@ -59,7 +59,9 @@ class UserTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
//$this->sharedFixture
|
parent::__construct();
|
||||||
|
|
||||||
|
//$this->sharedFixture
|
||||||
global $conf,$user,$langs,$db;
|
global $conf,$user,$langs,$db;
|
||||||
$this->savconf=$conf;
|
$this->savconf=$conf;
|
||||||
$this->savuser=$user;
|
$this->savuser=$user;
|
||||||
|
|||||||
@@ -55,9 +55,9 @@ class WebservicesInvoicesTest extends PHPUnit_Framework_TestCase
|
|||||||
protected $savdb;
|
protected $savdb;
|
||||||
protected $soapclient;
|
protected $soapclient;
|
||||||
protected $socid;
|
protected $socid;
|
||||||
|
|
||||||
protected $ns = 'http://www.dolibarr.org/ns/';
|
protected $ns = 'http://www.dolibarr.org/ns/';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
* We save global variables into local variables
|
* We save global variables into local variables
|
||||||
@@ -66,6 +66,8 @@ class WebservicesInvoicesTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
|
parent::__construct();
|
||||||
|
|
||||||
//$this->sharedFixture
|
//$this->sharedFixture
|
||||||
global $conf,$user,$langs,$db;
|
global $conf,$user,$langs,$db;
|
||||||
$this->savconf=$conf;
|
$this->savconf=$conf;
|
||||||
@@ -73,8 +75,8 @@ class WebservicesInvoicesTest extends PHPUnit_Framework_TestCase
|
|||||||
$this->savlangs=$langs;
|
$this->savlangs=$langs;
|
||||||
$this->savdb=$db;
|
$this->savdb=$db;
|
||||||
$WS_DOL_URL = DOL_MAIN_URL_ROOT.'/webservices/server_invoice.php';
|
$WS_DOL_URL = DOL_MAIN_URL_ROOT.'/webservices/server_invoice.php';
|
||||||
|
|
||||||
|
|
||||||
// Set the WebService URL
|
// Set the WebService URL
|
||||||
print __METHOD__." create nusoap_client for URL=".$WS_DOL_URL."\n";
|
print __METHOD__." create nusoap_client for URL=".$WS_DOL_URL."\n";
|
||||||
$this->soapclient = new nusoap_client($WS_DOL_URL);
|
$this->soapclient = new nusoap_client($WS_DOL_URL);
|
||||||
@@ -83,7 +85,7 @@ class WebservicesInvoicesTest extends PHPUnit_Framework_TestCase
|
|||||||
$this->soapclient->soap_defencoding='UTF-8';
|
$this->soapclient->soap_defencoding='UTF-8';
|
||||||
$this->soapclient->decodeUTF8(false);
|
$this->soapclient->decodeUTF8(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// create third_parties, needed to test an invoice
|
// create third_parties, needed to test an invoice
|
||||||
$societe=new Societe($db);
|
$societe=new Societe($db);
|
||||||
$societe->ref='';
|
$societe->ref='';
|
||||||
@@ -95,11 +97,11 @@ class WebservicesInvoicesTest extends PHPUnit_Framework_TestCase
|
|||||||
$societe->date_creation=$now;
|
$societe->date_creation=$now;
|
||||||
$societe->tva_assuj=0;
|
$societe->tva_assuj=0;
|
||||||
$societe->particulier=0;
|
$societe->particulier=0;
|
||||||
|
|
||||||
$societe->create($user);
|
$societe->create($user);
|
||||||
|
|
||||||
$this->socid = $societe->id;
|
$this->socid = $societe->id;
|
||||||
|
|
||||||
print __METHOD__." societe created id=".$societe->id."\n";
|
print __METHOD__." societe created id=".$societe->id."\n";
|
||||||
|
|
||||||
print __METHOD__." db->type=".$db->type." user->id=".$user->id;
|
print __METHOD__." db->type=".$db->type." user->id=".$user->id;
|
||||||
@@ -135,9 +137,9 @@ class WebservicesInvoicesTest extends PHPUnit_Framework_TestCase
|
|||||||
$user=$this->savuser;
|
$user=$this->savuser;
|
||||||
$langs=$this->savlangs;
|
$langs=$this->savlangs;
|
||||||
$db=$this->savdb;
|
$db=$this->savdb;
|
||||||
|
|
||||||
print __METHOD__."\n";
|
print __METHOD__."\n";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -171,7 +173,7 @@ class WebservicesInvoicesTest extends PHPUnit_Framework_TestCase
|
|||||||
$societe->fetch('', '', 'ref-phpunit');
|
$societe->fetch('', '', 'ref-phpunit');
|
||||||
print __METHOD__." societe loaded id=".$societe->id."\n";
|
print __METHOD__." societe loaded id=".$societe->id."\n";
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$body = array (
|
$body = array (
|
||||||
"id" => NULL,
|
"id" => NULL,
|
||||||
"ref" => NULL,
|
"ref" => NULL,
|
||||||
@@ -252,13 +254,13 @@ class WebservicesInvoicesTest extends PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testWSInvoicesGetInvoiceByRefExt
|
* testWSInvoicesGetInvoiceByRefExt
|
||||||
*
|
*
|
||||||
* Retrieve an invoice using ref_ext
|
* Retrieve an invoice using ref_ext
|
||||||
* @depends testWSInvoicesCreateInvoice
|
* @depends testWSInvoicesCreateInvoice
|
||||||
*
|
*
|
||||||
* @param array $result Invoice created by create method
|
* @param array $result Invoice created by create method
|
||||||
* @return array Invoice
|
* @return array Invoice
|
||||||
*/
|
*/
|
||||||
@@ -308,13 +310,13 @@ class WebservicesInvoicesTest extends PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testWSInvoicesUpdateInvoiceByRefExt
|
* testWSInvoicesUpdateInvoiceByRefExt
|
||||||
*
|
*
|
||||||
* Update an invoice using ref_ext
|
* Update an invoice using ref_ext
|
||||||
* @depends testWSInvoicesCreateInvoice
|
* @depends testWSInvoicesCreateInvoice
|
||||||
*
|
*
|
||||||
* @param array $result invoice created by create method
|
* @param array $result invoice created by create method
|
||||||
* @return array Invoice
|
* @return array Invoice
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -61,7 +61,9 @@ class WebservicesOrdersTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
//$this->sharedFixture
|
parent::__construct();
|
||||||
|
|
||||||
|
//$this->sharedFixture
|
||||||
global $conf,$user,$langs,$db;
|
global $conf,$user,$langs,$db;
|
||||||
$this->savconf=$conf;
|
$this->savconf=$conf;
|
||||||
$this->savuser=$user;
|
$this->savuser=$user;
|
||||||
|
|||||||
@@ -61,7 +61,9 @@ class WebservicesOtherTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
//$this->sharedFixture
|
parent::__construct();
|
||||||
|
|
||||||
|
//$this->sharedFixture
|
||||||
global $conf,$user,$langs,$db;
|
global $conf,$user,$langs,$db;
|
||||||
$this->savconf=$conf;
|
$this->savconf=$conf;
|
||||||
$this->savuser=$user;
|
$this->savuser=$user;
|
||||||
|
|||||||
@@ -68,7 +68,9 @@ class WebservicesProductsTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
//$this->sharedFixture
|
parent::__construct();
|
||||||
|
|
||||||
|
//$this->sharedFixture
|
||||||
global $conf,$user,$langs,$db;
|
global $conf,$user,$langs,$db;
|
||||||
$this->savconf=$conf;
|
$this->savconf=$conf;
|
||||||
$this->savuser=$user;
|
$this->savuser=$user;
|
||||||
|
|||||||
@@ -53,12 +53,12 @@ class WebservicesThirdpartyTest extends PHPUnit_Framework_TestCase
|
|||||||
protected $savlangs;
|
protected $savlangs;
|
||||||
protected $savdb;
|
protected $savdb;
|
||||||
protected $soapclient;
|
protected $soapclient;
|
||||||
|
|
||||||
private $_WS_DOL_URL;
|
private $_WS_DOL_URL;
|
||||||
private $_ns='http://www.dolibarr.org/ns/';
|
private $_ns='http://www.dolibarr.org/ns/';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
@@ -68,15 +68,17 @@ class WebservicesThirdpartyTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
//$this->sharedFixture
|
parent::__construct();
|
||||||
|
|
||||||
|
//$this->sharedFixture
|
||||||
global $conf,$user,$langs,$db;
|
global $conf,$user,$langs,$db;
|
||||||
$this->savconf=$conf;
|
$this->savconf=$conf;
|
||||||
$this->savuser=$user;
|
$this->savuser=$user;
|
||||||
$this->savlangs=$langs;
|
$this->savlangs=$langs;
|
||||||
$this->savdb=$db;
|
$this->savdb=$db;
|
||||||
|
|
||||||
$this->_WS_DOL_URL = DOL_MAIN_URL_ROOT.'/webservices/server_thirdparty.php';
|
$this->_WS_DOL_URL = DOL_MAIN_URL_ROOT.'/webservices/server_thirdparty.php';
|
||||||
|
|
||||||
// Set the WebService URL
|
// Set the WebService URL
|
||||||
print __METHOD__." create nusoap_client for URL=".$this->_WS_DOL_URL."\n";
|
print __METHOD__." create nusoap_client for URL=".$this->_WS_DOL_URL."\n";
|
||||||
$this->soapclient = new nusoap_client($this->_WS_DOL_URL);
|
$this->soapclient = new nusoap_client($this->_WS_DOL_URL);
|
||||||
@@ -146,10 +148,10 @@ class WebservicesThirdpartyTest extends PHPUnit_Framework_TestCase
|
|||||||
$user=$this->savuser;
|
$user=$this->savuser;
|
||||||
$langs=$this->savlangs;
|
$langs=$this->savlangs;
|
||||||
$db=$this->savdb;
|
$db=$this->savdb;
|
||||||
|
|
||||||
$WS_METHOD = 'createThirdParty';
|
$WS_METHOD = 'createThirdParty';
|
||||||
|
|
||||||
|
|
||||||
// Call the WebService method and store its result in $result.
|
// Call the WebService method and store its result in $result.
|
||||||
$authentication=array(
|
$authentication=array(
|
||||||
'dolibarrkey'=>$conf->global->WEBSERVICES_KEY,
|
'dolibarrkey'=>$conf->global->WEBSERVICES_KEY,
|
||||||
@@ -157,7 +159,7 @@ class WebservicesThirdpartyTest extends PHPUnit_Framework_TestCase
|
|||||||
'login'=>'admin',
|
'login'=>'admin',
|
||||||
'password'=>'admin',
|
'password'=>'admin',
|
||||||
'entity'=>'');
|
'entity'=>'');
|
||||||
|
|
||||||
$body = array (
|
$body = array (
|
||||||
"id" => NULL,
|
"id" => NULL,
|
||||||
"ref" => "name",
|
"ref" => "name",
|
||||||
@@ -195,7 +197,7 @@ class WebservicesThirdpartyTest extends PHPUnit_Framework_TestCase
|
|||||||
"vat_used" => "",
|
"vat_used" => "",
|
||||||
"vat_number" => ""
|
"vat_number" => ""
|
||||||
);
|
);
|
||||||
|
|
||||||
// Test URL
|
// Test URL
|
||||||
$result='';
|
$result='';
|
||||||
$parameters = array('authentication'=>$authentication, 'thirdparty'=>$body);
|
$parameters = array('authentication'=>$authentication, 'thirdparty'=>$body);
|
||||||
@@ -215,20 +217,20 @@ class WebservicesThirdpartyTest extends PHPUnit_Framework_TestCase
|
|||||||
print $this->soapclient->response;
|
print $this->soapclient->response;
|
||||||
print "\n";
|
print "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
print __METHOD__." result=".$result['result']['result_code']."\n";
|
print __METHOD__." result=".$result['result']['result_code']."\n";
|
||||||
$this->assertEquals('OK',$result['result']['result_code']);
|
$this->assertEquals('OK',$result['result']['result_code']);
|
||||||
$this->assertEquals('name',$result['ref']);
|
$this->assertEquals('name',$result['ref']);
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testWSThirdpartygetThirdPartyById
|
* testWSThirdpartygetThirdPartyById
|
||||||
*
|
*
|
||||||
* Use id to retrieve thirdparty
|
* Use id to retrieve thirdparty
|
||||||
* @depends testWSThirdpartycreateThirdParty
|
* @depends testWSThirdpartycreateThirdParty
|
||||||
*
|
*
|
||||||
* @param array $result thirdparty created by create method
|
* @param array $result thirdparty created by create method
|
||||||
* @return array thirpdarty updated
|
* @return array thirpdarty updated
|
||||||
*/
|
*/
|
||||||
@@ -278,18 +280,18 @@ class WebservicesThirdpartyTest extends PHPUnit_Framework_TestCase
|
|||||||
$this->assertEquals('0', $result['thirdparty']['status']);
|
$this->assertEquals('0', $result['thirdparty']['status']);
|
||||||
$this->assertEquals('1', $result['thirdparty']['client']);
|
$this->assertEquals('1', $result['thirdparty']['client']);
|
||||||
$this->assertEquals('0', $result['thirdparty']['supplier']);
|
$this->assertEquals('0', $result['thirdparty']['supplier']);
|
||||||
|
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testWSThirdpartygetThirdPartyByRefExt
|
* testWSThirdpartygetThirdPartyByRefExt
|
||||||
*
|
*
|
||||||
* Use ref_ext to retrieve thirdparty
|
* Use ref_ext to retrieve thirdparty
|
||||||
*
|
*
|
||||||
* @depends testWSThirdpartycreateThirdParty
|
* @depends testWSThirdpartycreateThirdParty
|
||||||
*
|
*
|
||||||
* @param array $result thirdparty created by create method
|
* @param array $result thirdparty created by create method
|
||||||
* @return array thirdparty
|
* @return array thirdparty
|
||||||
*/
|
*/
|
||||||
@@ -301,9 +303,9 @@ class WebservicesThirdpartyTest extends PHPUnit_Framework_TestCase
|
|||||||
$langs=$this->savlangs;
|
$langs=$this->savlangs;
|
||||||
$db=$this->savdb;
|
$db=$this->savdb;
|
||||||
$id = $result['id'];
|
$id = $result['id'];
|
||||||
|
|
||||||
$WS_METHOD = 'getThirdParty';
|
$WS_METHOD = 'getThirdParty';
|
||||||
|
|
||||||
// Call the WebService method and store its result in $result.
|
// Call the WebService method and store its result in $result.
|
||||||
$authentication=array(
|
$authentication=array(
|
||||||
'dolibarrkey'=>$conf->global->WEBSERVICES_KEY,
|
'dolibarrkey'=>$conf->global->WEBSERVICES_KEY,
|
||||||
@@ -311,7 +313,7 @@ class WebservicesThirdpartyTest extends PHPUnit_Framework_TestCase
|
|||||||
'login'=>'admin',
|
'login'=>'admin',
|
||||||
'password'=>'admin',
|
'password'=>'admin',
|
||||||
'entity'=>'');
|
'entity'=>'');
|
||||||
|
|
||||||
// Test URL
|
// Test URL
|
||||||
$result='';
|
$result='';
|
||||||
$parameters = array('authentication'=>$authentication, 'id'=>'', 'ref'=>'', 'ref_ext'=>'12');
|
$parameters = array('authentication'=>$authentication, 'id'=>'', 'ref'=>'', 'ref_ext'=>'12');
|
||||||
@@ -332,7 +334,7 @@ class WebservicesThirdpartyTest extends PHPUnit_Framework_TestCase
|
|||||||
print $this->soapclient->response;
|
print $this->soapclient->response;
|
||||||
print "\n";
|
print "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
print __METHOD__." result=".$result['result']['result_code']."\n";
|
print __METHOD__." result=".$result['result']['result_code']."\n";
|
||||||
$this->assertEquals('OK',$result['result']['result_code']);
|
$this->assertEquals('OK',$result['result']['result_code']);
|
||||||
$this->assertEquals($id, $result['thirdparty']['id']);
|
$this->assertEquals($id, $result['thirdparty']['id']);
|
||||||
@@ -341,11 +343,11 @@ class WebservicesThirdpartyTest extends PHPUnit_Framework_TestCase
|
|||||||
$this->assertEquals('0', $result['thirdparty']['status']);
|
$this->assertEquals('0', $result['thirdparty']['status']);
|
||||||
$this->assertEquals('1', $result['thirdparty']['client']);
|
$this->assertEquals('1', $result['thirdparty']['client']);
|
||||||
$this->assertEquals('0', $result['thirdparty']['supplier']);
|
$this->assertEquals('0', $result['thirdparty']['supplier']);
|
||||||
|
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testWSThirdpartydeleteThirdParty
|
* testWSThirdpartydeleteThirdParty
|
||||||
*
|
*
|
||||||
@@ -362,9 +364,9 @@ class WebservicesThirdpartyTest extends PHPUnit_Framework_TestCase
|
|||||||
$langs=$this->savlangs;
|
$langs=$this->savlangs;
|
||||||
$db=$this->savdb;
|
$db=$this->savdb;
|
||||||
$id = $result['id'];
|
$id = $result['id'];
|
||||||
|
|
||||||
$WS_METHOD = 'deleteThirdParty';
|
$WS_METHOD = 'deleteThirdParty';
|
||||||
|
|
||||||
// Call the WebService method and store its result in $result.
|
// Call the WebService method and store its result in $result.
|
||||||
$authentication=array(
|
$authentication=array(
|
||||||
'dolibarrkey'=>$conf->global->WEBSERVICES_KEY,
|
'dolibarrkey'=>$conf->global->WEBSERVICES_KEY,
|
||||||
@@ -372,7 +374,7 @@ class WebservicesThirdpartyTest extends PHPUnit_Framework_TestCase
|
|||||||
'login'=>'admin',
|
'login'=>'admin',
|
||||||
'password'=>'admin',
|
'password'=>'admin',
|
||||||
'entity'=>'');
|
'entity'=>'');
|
||||||
|
|
||||||
$result='';
|
$result='';
|
||||||
$parameters = array('authentication'=>$authentication, 'id'=>$id, 'ref'=>'', 'ref_ext'=>'');
|
$parameters = array('authentication'=>$authentication, 'id'=>$id, 'ref'=>'', 'ref_ext'=>'');
|
||||||
print __METHOD__." call method ".$WS_METHOD."\n";
|
print __METHOD__." call method ".$WS_METHOD."\n";
|
||||||
@@ -393,7 +395,7 @@ class WebservicesThirdpartyTest extends PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
print __METHOD__." result=".$result['result']['result_code']."\n";
|
print __METHOD__." result=".$result['result']['result_code']."\n";
|
||||||
$this->assertEquals('OK',$result['result']['result_code']);
|
$this->assertEquals('OK',$result['result']['result_code']);
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -61,7 +61,9 @@ class WebservicesUserTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
//$this->sharedFixture
|
parent::__construct();
|
||||||
|
|
||||||
|
//$this->sharedFixture
|
||||||
global $conf,$user,$langs,$db;
|
global $conf,$user,$langs,$db;
|
||||||
$this->savconf=$conf;
|
$this->savconf=$conf;
|
||||||
$this->savuser=$user;
|
$this->savuser=$user;
|
||||||
|
|||||||
@@ -59,7 +59,9 @@ class XCalLibTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
//$this->sharedFixture
|
parent::__construct();
|
||||||
|
|
||||||
|
//$this->sharedFixture
|
||||||
global $conf,$user,$langs,$db;
|
global $conf,$user,$langs,$db;
|
||||||
$this->savconf=$conf;
|
$this->savconf=$conf;
|
||||||
$this->savuser=$user;
|
$this->savuser=$user;
|
||||||
|
|||||||
Reference in New Issue
Block a user