mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-09 09:22:36 +01:00
Qual: Move a not frequently used function out of functions.lib.php
Enhance PHPUnit tests
This commit is contained in:
@@ -209,6 +209,39 @@ class DateLibTest extends PHPUnit_Framework_TestCase
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
public function testDolStringToTime()
|
||||
{
|
||||
global $conf,$user,$langs,$db;
|
||||
$conf=$this->savconf;
|
||||
$user=$this->savuser;
|
||||
$langs=$this->savlangs;
|
||||
$db=$this->savdb;
|
||||
|
||||
$stime='1970-01-01T02:00:00Z';
|
||||
$result=dol_stringtotime($stime);
|
||||
print __METHOD__." result=".$result."\n";
|
||||
$this->assertEquals(7200,$result);
|
||||
|
||||
$stime='19700101T020000Z';
|
||||
$result=dol_stringtotime($stime);
|
||||
print __METHOD__." result=".$result."\n";
|
||||
$this->assertEquals(7200,$result);
|
||||
|
||||
$stime='19700101020000';
|
||||
$result=dol_stringtotime($stime);
|
||||
print __METHOD__." result=".$result."\n";
|
||||
$this->assertEquals(7200,$result);
|
||||
|
||||
$stime='19700101';
|
||||
$result=dol_stringtotime($stime);
|
||||
print __METHOD__." result=".$result."\n";
|
||||
$this->assertEquals(0,$result);
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
public function testDolGetFirstDay()
|
||||
|
||||
Reference in New Issue
Block a user