Fix travis error

This commit is contained in:
Laurent Destailleur
2017-05-22 01:19:16 +02:00
parent ecce1c2037
commit a3eef35ce6
5 changed files with 24 additions and 1802 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -615,19 +615,20 @@ function dol_buildpath($path, $type=0)
}
/**
* Create a clone of instance of object (new instance with same properties)
* This function works for both PHP4 and PHP5
* Create a clone of instance of object (new instance with same value for properties)
* Property that are reference are also new object (true clone)
*
* @param object $object Object to 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
*/
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;
}

View File

@@ -432,9 +432,16 @@ class FilesLibTest extends PHPUnit_Framework_TestCase
$langs=$this->savlangs;
$db=$this->savdb;
//$dummyuser=new User($db);
//$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->creer = 0;
$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
$result=dol_check_secure_access_document('facture', $filename, 0, '', '', 'write');
$this->assertEquals(0,$result['accessallowed']);
// We restore user properties
$user->rights->facture->lire = $savpermlire;
$user->rights->facture->creer = $savpermcreer;
}
}

View File

@@ -154,10 +154,6 @@ class NumberingModulesTest extends PHPUnit_Framework_TestCase
$result=$localobject->is_erasable();
print __METHOD__." is_erasable=".$result."\n";
$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->initAsSpecimen();
$localobject2->date=dol_mktime(12, 0, 0, 1, 1, 1916); // we use following year for second invoice (there is no reset into mask)