mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-18 07:21:30 +01:00
Qual: Move a not frequently used function out of functions.lib.php
Enhance PHPUnit tests
This commit is contained in:
@@ -23,6 +23,7 @@ require_once(DOL_DOCUMENT_ROOT.'/cashdesk/class/Facturation.class.php');
|
|||||||
require_once(DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php');
|
require_once(DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php');
|
||||||
require_once(DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php');
|
require_once(DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php');
|
||||||
require_once(DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php');
|
require_once(DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php');
|
||||||
|
require_once(DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php');
|
||||||
|
|
||||||
$obj_facturation = unserialize($_SESSION['serObjFacturation']);
|
$obj_facturation = unserialize($_SESSION['serObjFacturation']);
|
||||||
unset ($_SESSION['serObjFacturation']);
|
unset ($_SESSION['serObjFacturation']);
|
||||||
|
|||||||
@@ -27,13 +27,14 @@
|
|||||||
|
|
||||||
require("../../main.inc.php");
|
require("../../main.inc.php");
|
||||||
require_once(DOL_DOCUMENT_ROOT."/core/lib/agenda.lib.php");
|
require_once(DOL_DOCUMENT_ROOT."/core/lib/agenda.lib.php");
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/core/lib/project.lib.php");
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/core/lib/date.lib.php");
|
||||||
require_once(DOL_DOCUMENT_ROOT."/contact/class/contact.class.php");
|
require_once(DOL_DOCUMENT_ROOT."/contact/class/contact.class.php");
|
||||||
require_once(DOL_DOCUMENT_ROOT."/user/class/user.class.php");
|
require_once(DOL_DOCUMENT_ROOT."/user/class/user.class.php");
|
||||||
require_once(DOL_DOCUMENT_ROOT."/comm/action/class/cactioncomm.class.php");
|
require_once(DOL_DOCUMENT_ROOT."/comm/action/class/cactioncomm.class.php");
|
||||||
require_once(DOL_DOCUMENT_ROOT."/comm/action/class/actioncomm.class.php");
|
require_once(DOL_DOCUMENT_ROOT."/comm/action/class/actioncomm.class.php");
|
||||||
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formactions.class.php");
|
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formactions.class.php");
|
||||||
require_once(DOL_DOCUMENT_ROOT."/projet/class/project.class.php");
|
require_once(DOL_DOCUMENT_ROOT."/projet/class/project.class.php");
|
||||||
require_once(DOL_DOCUMENT_ROOT."/core/lib/project.lib.php");
|
|
||||||
|
|
||||||
$langs->load("companies");
|
$langs->load("companies");
|
||||||
$langs->load("commercial");
|
$langs->load("commercial");
|
||||||
|
|||||||
@@ -510,7 +510,7 @@ if (count($listofextcals))
|
|||||||
require_once(DOL_DOCUMENT_ROOT."/comm/action/class/ical.class.php");
|
require_once(DOL_DOCUMENT_ROOT."/comm/action/class/ical.class.php");
|
||||||
foreach($listofextcals as $extcal)
|
foreach($listofextcals as $extcal)
|
||||||
{
|
{
|
||||||
$url=$extcal['src'];
|
$url=$extcal['src']; // Example: https://www.google.com/calendar/ical/eldy10%40gmail.com/private-cde92aa7d7e0ef6110010a821a2aaeb/basic.ics
|
||||||
$namecal = $extcal['name'];
|
$namecal = $extcal['name'];
|
||||||
$colorcal = $extcal['color'];
|
$colorcal = $extcal['color'];
|
||||||
//print "url=".$url." namecal=".$namecal." colorcal=".$colorcal;
|
//print "url=".$url." namecal=".$namecal." colorcal=".$colorcal;
|
||||||
@@ -520,14 +520,34 @@ if (count($listofextcals))
|
|||||||
if (is_array($ical->get_event_list())) $icalevents=array_merge($icalevents,$ical->get_event_list());
|
if (is_array($ical->get_event_list())) $icalevents=array_merge($icalevents,$ical->get_event_list());
|
||||||
if (is_array($ical->get_freebusy_list())) $icalevents=array_merge($icalevents,$ical->get_freebusy_list());
|
if (is_array($ical->get_freebusy_list())) $icalevents=array_merge($icalevents,$ical->get_freebusy_list());
|
||||||
|
|
||||||
if(count($icalevents)>0)
|
if (count($icalevents)>0)
|
||||||
{
|
{
|
||||||
|
// Duplicate all repeatable events into new entries
|
||||||
foreach($icalevents as $icalevent)
|
foreach($icalevents as $icalevent)
|
||||||
{
|
{
|
||||||
|
if (is_array($icalevent['RRULE'])) //repeatable event
|
||||||
|
{
|
||||||
|
//if ($event->date_start_in_calendar < $firstdaytoshow) $event->date_start_in_calendar=$firstdaytoshow;
|
||||||
|
//if ($event->date_end_in_calendar > $lastdaytoshow) $event->date_end_in_calendar=$lastdaytoshow;
|
||||||
|
$datecur=$icalevent['DTSTART']['unixtime'];
|
||||||
|
if ($icalevent['RRULE']['FREQ']=='WEEKLY')
|
||||||
|
{
|
||||||
|
$until=dol_stringtotime($icalevent['RRULE']['UNTIL'],1);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Loop on each entry into cal file to know if entry is qualified and add an ActionComm into $eventarray
|
||||||
|
foreach($icalevents as $icalevent)
|
||||||
|
{
|
||||||
|
//print $icalevent['SUMMARY'].'->'.var_dump($icalevent).'<br>';exit;
|
||||||
|
|
||||||
// Create a new object action
|
// Create a new object action
|
||||||
$event=new ActionComm($db);
|
$event=new ActionComm($db);
|
||||||
$addevent = false;
|
$addevent = false;
|
||||||
if($icalevent['DTSTART;VALUE=DATE']) //fullday event
|
if ($icalevent['DTSTART;VALUE=DATE']) //fullday event
|
||||||
{
|
{
|
||||||
// For full day events, date are also GMT but they wont but converted using tz during output
|
// For full day events, date are also GMT but they wont but converted using tz during output
|
||||||
$datestart=dol_stringtotime($icalevent['DTSTART;VALUE=DATE'],1);
|
$datestart=dol_stringtotime($icalevent['DTSTART;VALUE=DATE'],1);
|
||||||
@@ -537,18 +557,21 @@ if (count($listofextcals))
|
|||||||
$event->fulldayevent=true;
|
$event->fulldayevent=true;
|
||||||
$addevent=true;
|
$addevent=true;
|
||||||
}
|
}
|
||||||
elseif (is_array($icalevent['RRULE'])) //repeatable event
|
elseif (!is_array($icalevent['DTSTART'])) //non-repeatable and not fullday event DTSTART;TZID=Europe/Paris:20120102T100000
|
||||||
{
|
|
||||||
$addevent=false; //TODO: a faire
|
|
||||||
}
|
|
||||||
elseif(!is_array($icalevent['DTSTART'])) //non-repeatable and not fullday event
|
|
||||||
{
|
{
|
||||||
$datestart=$icalevent['DTSTART'];
|
$datestart=$icalevent['DTSTART'];
|
||||||
$dateend=$icalevent['DTEND'];
|
$dateend=$icalevent['DTEND'];
|
||||||
$addevent=true;
|
$addevent=true;
|
||||||
}
|
}
|
||||||
|
//elseif (is_array($icalevent['DTSTART']) && ! empty($icalevent['DTSTART']['unixtime']) && ! is_array($icalevent['RRULE']))
|
||||||
|
elseif (is_array($icalevent['DTSTART']) && ! empty($icalevent['DTSTART']['unixtime']))
|
||||||
|
{
|
||||||
|
$datestart=$icalevent['DTSTART']['unixtime'];
|
||||||
|
$dateend=$icalevent['DTEND']['unixtime'];
|
||||||
|
$addevent=true;
|
||||||
|
}
|
||||||
|
|
||||||
if($addevent)
|
if ($addevent)
|
||||||
{
|
{
|
||||||
$event->id=$icalevent['UID'];
|
$event->id=$icalevent['UID'];
|
||||||
$event->icalname=$namecal;
|
$event->icalname=$namecal;
|
||||||
@@ -573,7 +596,7 @@ if (count($listofextcals))
|
|||||||
$event->ponctuel=1;
|
$event->ponctuel=1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check values
|
// Add event into $eventarray if date range are ok.
|
||||||
if ($event->date_end_in_calendar < $firstdaytoshow || $event->date_start_in_calendar > $lastdaytoshow)
|
if ($event->date_end_in_calendar < $firstdaytoshow || $event->date_start_in_calendar > $lastdaytoshow)
|
||||||
{
|
{
|
||||||
// This record is out of visible range
|
// This record is out of visible range
|
||||||
|
|||||||
@@ -533,6 +533,8 @@ class Contact extends CommonObject
|
|||||||
$this->priv = $obj->priv;
|
$this->priv = $obj->priv;
|
||||||
$this->mail = $obj->email;
|
$this->mail = $obj->email;
|
||||||
|
|
||||||
|
// TODO Replace birthday with a date selector
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/core/lib/date.lib.php");
|
||||||
$this->birthday = dol_stringtotime($obj->birthday);
|
$this->birthday = dol_stringtotime($obj->birthday);
|
||||||
//print "fetch: ".$obj->birthday.'-'.$this->birthday;
|
//print "fetch: ".$obj->birthday.'-'.$this->birthday;
|
||||||
$this->birthday_alert = $obj->birthday_alert;
|
$this->birthday_alert = $obj->birthday_alert;
|
||||||
|
|||||||
@@ -198,6 +198,70 @@ function ConvertSecondToTime($iSecond,$format='all',$lengthOfDay=86400,$lengthOf
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert a string date into a GM Timestamps date
|
||||||
|
*
|
||||||
|
* @param string $string Date in a string
|
||||||
|
* YYYYMMDD
|
||||||
|
* YYYYMMDDHHMMSS
|
||||||
|
* YYYYMMDDTHHMMSSZ
|
||||||
|
* YYYY-MM-DDTHH:MM:SSZ (RFC3339)
|
||||||
|
* DD/MM/YY or DD/MM/YYYY (this format should not be used anymore)
|
||||||
|
* DD/MM/YY HH:MM:SS or DD/MM/YYYY HH:MM:SS (this format should not be used anymore)
|
||||||
|
* @param int $gm 1=Input date is GM date, 0=Input date is local date
|
||||||
|
* 19700101020000 -> 7200 with gm=1
|
||||||
|
* @return date Date
|
||||||
|
*
|
||||||
|
* @see dol_print_date, dol_mktime, dol_getdate
|
||||||
|
*/
|
||||||
|
function dol_stringtotime($string, $gm=1)
|
||||||
|
{
|
||||||
|
// Convert date with format DD/MM/YYY HH:MM:SS. This part of code should not be used.
|
||||||
|
if (preg_match('/^([0-9]+)\/([0-9]+)\/([0-9]+)\s?([0-9]+)?:?([0-9]+)?:?([0-9]+)?/i',$string,$reg))
|
||||||
|
{
|
||||||
|
dol_syslog("dol_stringtotime call to function with deprecated parameter", LOG_WARNING);
|
||||||
|
// Date est au format 'DD/MM/YY' ou 'DD/MM/YY HH:MM:SS'
|
||||||
|
// Date est au format 'DD/MM/YYYY' ou 'DD/MM/YYYY HH:MM:SS'
|
||||||
|
$sday = $reg[1];
|
||||||
|
$smonth = $reg[2];
|
||||||
|
$syear = $reg[3];
|
||||||
|
$shour = $reg[4];
|
||||||
|
$smin = $reg[5];
|
||||||
|
$ssec = $reg[6];
|
||||||
|
if ($syear < 50) $syear+=1900;
|
||||||
|
if ($syear >= 50 && $syear < 100) $syear+=2000;
|
||||||
|
$string=sprintf("%04d%02d%02d%02d%02d%02d",$syear,$smonth,$sday,$shour,$smin,$ssec);
|
||||||
|
}
|
||||||
|
// Convert date with format RFC3339
|
||||||
|
else if (preg_match('/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})Z$/i',$string,$reg))
|
||||||
|
{
|
||||||
|
$syear = $reg[1];
|
||||||
|
$smonth = $reg[2];
|
||||||
|
$sday = $reg[3];
|
||||||
|
$shour = $reg[4];
|
||||||
|
$smin = $reg[5];
|
||||||
|
$ssec = $reg[6];
|
||||||
|
$string=sprintf("%04d%02d%02d%02d%02d%02d",$syear,$smonth,$sday,$shour,$smin,$ssec);
|
||||||
|
}
|
||||||
|
// Convert date with format YYYYMMDDTHHMMSSZ
|
||||||
|
else if (preg_match('/^([0-9]{4})([0-9]{2})([0-9]{2})T([0-9]{2})([0-9]{2})([0-9]{2})Z$/i',$string,$reg))
|
||||||
|
{
|
||||||
|
$syear = $reg[1];
|
||||||
|
$smonth = $reg[2];
|
||||||
|
$sday = $reg[3];
|
||||||
|
$shour = $reg[4];
|
||||||
|
$smin = $reg[5];
|
||||||
|
$ssec = $reg[6];
|
||||||
|
$string=sprintf("%04d%02d%02d%02d%02d%02d",$syear,$smonth,$sday,$shour,$smin,$ssec);
|
||||||
|
}
|
||||||
|
|
||||||
|
$string=preg_replace('/([^0-9])/i','',$string);
|
||||||
|
$tmp=$string.'000000';
|
||||||
|
$date=dol_mktime(substr($tmp,8,2),substr($tmp,10,2),substr($tmp,12,2),substr($tmp,4,2),substr($tmp,6,2),substr($tmp,0,4),$gm);
|
||||||
|
return $date;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/** Return previous day
|
/** Return previous day
|
||||||
*
|
*
|
||||||
* @param int $day Day
|
* @param int $day Day
|
||||||
|
|||||||
@@ -972,58 +972,6 @@ function dol_print_date($time,$format='',$tzoutput='tzserver',$outputlangs='',$e
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Convert a string date into a GM Timestamps date
|
|
||||||
*
|
|
||||||
* @param string $string Date in a string
|
|
||||||
* YYYYMMDD
|
|
||||||
* YYYYMMDDHHMMSS
|
|
||||||
* YYYY-MM-DDTHH:MM:SSZ (RFC3339)
|
|
||||||
* DD/MM/YY or DD/MM/YYYY (this format should not be used anymore)
|
|
||||||
* DD/MM/YY HH:MM:SS or DD/MM/YYYY HH:MM:SS (this format should not be used anymore)
|
|
||||||
* @param int $gm 1=Input date is GM date, 0=Input date is local date
|
|
||||||
* 19700101020000 -> 7200 with gm=1
|
|
||||||
* @return date Date
|
|
||||||
*
|
|
||||||
* @see dol_print_date, dol_mktime, dol_getdate
|
|
||||||
*/
|
|
||||||
function dol_stringtotime($string, $gm=1)
|
|
||||||
{
|
|
||||||
if (preg_match('/^([0-9]+)\/([0-9]+)\/([0-9]+)\s?([0-9]+)?:?([0-9]+)?:?([0-9]+)?/i',$string,$reg))
|
|
||||||
{
|
|
||||||
// This part of code should not be used.
|
|
||||||
dol_syslog("Functions.lib::dol_stringtotime call to function with deprecated parameter", LOG_WARNING);
|
|
||||||
// Date est au format 'DD/MM/YY' ou 'DD/MM/YY HH:MM:SS'
|
|
||||||
// Date est au format 'DD/MM/YYYY' ou 'DD/MM/YYYY HH:MM:SS'
|
|
||||||
$sday = $reg[1];
|
|
||||||
$smonth = $reg[2];
|
|
||||||
$syear = $reg[3];
|
|
||||||
$shour = $reg[4];
|
|
||||||
$smin = $reg[5];
|
|
||||||
$ssec = $reg[6];
|
|
||||||
if ($syear < 50) $syear+=1900;
|
|
||||||
if ($syear >= 50 && $syear < 100) $syear+=2000;
|
|
||||||
$string=sprintf("%04d%02d%02d%02d%02d%02d",$syear,$smonth,$sday,$shour,$smin,$ssec);
|
|
||||||
}
|
|
||||||
// Convert date RFC3339
|
|
||||||
else if (preg_match('/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})Z$/i',$string,$reg))
|
|
||||||
{
|
|
||||||
$syear = $reg[1];
|
|
||||||
$smonth = $reg[2];
|
|
||||||
$sday = $reg[3];
|
|
||||||
$shour = $reg[4];
|
|
||||||
$smin = $reg[5];
|
|
||||||
$ssec = $reg[6];
|
|
||||||
$string=sprintf("%04d%02d%02d%02d%02d%02d",$syear,$smonth,$sday,$shour,$smin,$ssec);
|
|
||||||
}
|
|
||||||
|
|
||||||
$string=preg_replace('/([^0-9])/i','',$string);
|
|
||||||
$tmp=$string.'000000';
|
|
||||||
$date=dol_mktime(substr($tmp,8,2),substr($tmp,10,2),substr($tmp,12,2),substr($tmp,4,2),substr($tmp,6,2),substr($tmp,0,4),$gm);
|
|
||||||
return $date;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return an array with date info
|
* Return an array with date info
|
||||||
* PHP getdate is restricted to the years 1901-2038 on Unix and 1970-2038 on Windows
|
* PHP getdate is restricted to the years 1901-2038 on Unix and 1970-2038 on Windows
|
||||||
|
|||||||
@@ -23,6 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
require_once(DOL_DOCUMENT_ROOT."/core/modules/export/modules_export.php");
|
require_once(DOL_DOCUMENT_ROOT."/core/modules/export/modules_export.php");
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/core/lib/date.lib.php");
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
|
|
||||||
require_once(DOL_DOCUMENT_ROOT."/core/modules/export/modules_export.php");
|
require_once(DOL_DOCUMENT_ROOT."/core/modules/export/modules_export.php");
|
||||||
require_once(DOL_DOCUMENT_ROOT."/core/modules/export/export_excel.modules.php");
|
require_once(DOL_DOCUMENT_ROOT."/core/modules/export/export_excel.modules.php");
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/core/lib/date.lib.php");
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -392,6 +392,7 @@ if (! defined('NOLOGIN'))
|
|||||||
$dol_dst=0;
|
$dol_dst=0;
|
||||||
if (isset($_POST["dst_first"]) && isset($_POST["dst_second"]))
|
if (isset($_POST["dst_first"]) && isset($_POST["dst_second"]))
|
||||||
{
|
{
|
||||||
|
include_once(DOL_DOCUMENT_ROOT."/core/lib/date.lib.php");
|
||||||
$datenow=dol_now();
|
$datenow=dol_now();
|
||||||
$datefirst=dol_stringtotime($_POST["dst_first"]);
|
$datefirst=dol_stringtotime($_POST["dst_first"]);
|
||||||
$datesecond=dol_stringtotime($_POST["dst_second"]);
|
$datesecond=dol_stringtotime($_POST["dst_second"]);
|
||||||
@@ -416,7 +417,7 @@ if (! defined('NOLOGIN'))
|
|||||||
$_SESSION["dol_loginmesg"]=$langs->trans("ErrorBadLoginPassword");
|
$_SESSION["dol_loginmesg"]=$langs->trans("ErrorBadLoginPassword");
|
||||||
|
|
||||||
// Appel des triggers
|
// Appel des triggers
|
||||||
include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");
|
include_once(DOL_DOCUMENT_ROOT."/core/class/interfaces.class.php");
|
||||||
$interface=new Interfaces($db);
|
$interface=new Interfaces($db);
|
||||||
$result=$interface->run_triggers('USER_LOGIN_FAILED',$user,$user,$langs,$conf,GETPOST("username","alpha",2));
|
$result=$interface->run_triggers('USER_LOGIN_FAILED',$user,$user,$langs,$conf,GETPOST("username","alpha",2));
|
||||||
if ($result < 0) { $error++; }
|
if ($result < 0) { $error++; }
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/php
|
#!/usr/bin/php
|
||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2009-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2009-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -40,6 +40,7 @@ require_once(DOL_DOCUMENT_ROOT."/cron/functions_cron.lib.php");
|
|||||||
require_once(DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php");
|
require_once(DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php");
|
||||||
require_once(DOL_DOCUMENT_ROOT."/core/modules/facture/modules_facture.php");
|
require_once(DOL_DOCUMENT_ROOT."/core/modules/facture/modules_facture.php");
|
||||||
require_once(DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php');
|
require_once(DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php');
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/core/lib/date.lib.php");
|
||||||
|
|
||||||
|
|
||||||
// Load main language strings
|
// Load main language strings
|
||||||
|
|||||||
@@ -209,6 +209,39 @@ class DateLibTest extends PHPUnit_Framework_TestCase
|
|||||||
return $result;
|
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()
|
public function testDolGetFirstDay()
|
||||||
|
|||||||
Reference in New Issue
Block a user