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

@@ -343,4 +343,24 @@ class DateLibTest extends PHPUnit_Framework_TestCase
return $result;
}
/**
* testDolGetFirstDayWeek
*
* @return int
*/
public function testDolGetFirstDayWeek()
{
global $conf;
$day=3; $month=2; $year=2015;
$conf->global->MAIN_START_WEEK = 1; // start on monday
$prev = dol_get_first_day_week($day, $month, $year);
$this->assertEquals(2, (int) $prev['first_day']); // monday for month 2, year 2014 is the 2
$day=3; $month=2; $year=2015;
$conf->global->MAIN_START_WEEK = 0; // start on sunday
$prev = dol_get_first_day_week($day, $month, $year);
$this->assertEquals(1, (int) $prev['first_day']); // sunday for month 2, year 2015 is the 1st
}
}