Merge remote-tracking branch 'origin/3.7' into develop

Conflicts:
	htdocs/comm/action/card.php
	htdocs/core/datepicker.php
This commit is contained in:
Laurent Destailleur
2015-02-03 12:17:45 +01:00
8 changed files with 100 additions and 32 deletions

View File

@@ -890,4 +890,32 @@ class FunctionsLibTest extends PHPUnit_Framework_TestCase
return true;
}
/**
* testDolGetDate
*
* @return boolean
*/
public function testDolGetDate()
{
global $conf;
$conf->global->MAIN_START_WEEK = 0;
$tmp=dol_getdate(1); // 1/1/1970 and 1 second = thirday
$this->assertEquals(4, $tmp['wday']);
$tmp=dol_getdate(24*60*60+1); // 2/1/1970 and 1 second = friday
$this->assertEquals(5, $tmp['wday']);
$conf->global->MAIN_START_WEEK = 1;
$tmp=dol_getdate(1); // 1/1/1970 and 1 second = thirday
$this->assertEquals(4, $tmp['wday']);
$tmp=dol_getdate(24*60*60+1); // 2/1/1970 and 1 second = friday
$this->assertEquals(5, $tmp['wday']);
return true;
}
}