mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-08 02:28:23 +01:00
Fix travis error
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -615,19 +615,20 @@ function dol_buildpath($path, $type=0)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a clone of instance of object (new instance with same properties)
|
* Create a clone of instance of object (new instance with same value for properties)
|
||||||
* This function works for both PHP4 and PHP5
|
* Property that are reference are also new object (true clone)
|
||||||
*
|
*
|
||||||
* @param object $object Object to clone
|
* @param object $object Object to clone
|
||||||
* @return object Object clone
|
* @return object Object clone
|
||||||
* @deprecated Dolibarr no longer supports PHP4, use PHP5 native clone construct
|
|
||||||
* @see https://php.net/manual/language.oop5.cloning.php
|
* @see https://php.net/manual/language.oop5.cloning.php
|
||||||
*/
|
*/
|
||||||
function dol_clone($object)
|
function dol_clone($object)
|
||||||
{
|
{
|
||||||
dol_syslog(__FUNCTION__ . " is deprecated", LOG_WARNING);
|
//dol_syslog(__FUNCTION__ . " is deprecated", LOG_WARNING);
|
||||||
|
|
||||||
|
//$myclone = clone $object; // PHP clone is a shallow copy only, not a real clone, so properties of references will keep references (refer to the same target/variable
|
||||||
|
$myclone=unserialize(serialize($object));
|
||||||
|
|
||||||
$myclone = clone $object;
|
|
||||||
return $myclone;
|
return $myclone;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -432,9 +432,16 @@ class FilesLibTest extends PHPUnit_Framework_TestCase
|
|||||||
$langs=$this->savlangs;
|
$langs=$this->savlangs;
|
||||||
$db=$this->savdb;
|
$db=$this->savdb;
|
||||||
|
|
||||||
|
|
||||||
//$dummyuser=new User($db);
|
//$dummyuser=new User($db);
|
||||||
//$result=restrictedArea($dummyuser,'societe');
|
//$result=restrictedArea($dummyuser,'societe');
|
||||||
|
|
||||||
|
// We save user properties
|
||||||
|
$savpermlire = $user->rights->facture->lire;
|
||||||
|
$savpermcreer = $user->rights->facture->creer;
|
||||||
|
|
||||||
|
|
||||||
|
// Check access to SPECIMEN
|
||||||
$user->rights->facture->lire = 0;
|
$user->rights->facture->lire = 0;
|
||||||
$user->rights->facture->creer = 0;
|
$user->rights->facture->creer = 0;
|
||||||
$filename='SPECIMEN.pdf'; // Filename relative to module part
|
$filename='SPECIMEN.pdf'; // Filename relative to module part
|
||||||
@@ -473,6 +480,11 @@ class FilesLibTest extends PHPUnit_Framework_TestCase
|
|||||||
$filename='FA010101/FA010101.pdf'; // Filename relative to module part
|
$filename='FA010101/FA010101.pdf'; // Filename relative to module part
|
||||||
$result=dol_check_secure_access_document('facture', $filename, 0, '', '', 'write');
|
$result=dol_check_secure_access_document('facture', $filename, 0, '', '', 'write');
|
||||||
$this->assertEquals(0,$result['accessallowed']);
|
$this->assertEquals(0,$result['accessallowed']);
|
||||||
|
|
||||||
|
|
||||||
|
// We restore user properties
|
||||||
|
$user->rights->facture->lire = $savpermlire;
|
||||||
|
$user->rights->facture->creer = $savpermcreer;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -154,10 +154,6 @@ class NumberingModulesTest extends PHPUnit_Framework_TestCase
|
|||||||
$result=$localobject->is_erasable();
|
$result=$localobject->is_erasable();
|
||||||
print __METHOD__." is_erasable=".$result."\n";
|
print __METHOD__." is_erasable=".$result."\n";
|
||||||
$this->assertEquals(1, $result, 'Test for is_erasable, 1st invoice'); // Can be deleted
|
$this->assertEquals(1, $result, 'Test for is_erasable, 1st invoice'); // Can be deleted
|
||||||
|
|
||||||
$out=file_get_contents(DOL_DATA_ROOT.'/dolibarr.log');
|
|
||||||
print $out;
|
|
||||||
|
|
||||||
$localobject2=new Facture($this->savdb);
|
$localobject2=new Facture($this->savdb);
|
||||||
$localobject2->initAsSpecimen();
|
$localobject2->initAsSpecimen();
|
||||||
$localobject2->date=dol_mktime(12, 0, 0, 1, 1, 1916); // we use following year for second invoice (there is no reset into mask)
|
$localobject2->date=dol_mktime(12, 0, 0, 1, 1, 1916); // we use following year for second invoice (there is no reset into mask)
|
||||||
|
|||||||
Reference in New Issue
Block a user