mirror of
https://github.com/php/php-src.git
synced 2026-04-24 08:28:26 +02:00
Fix new date tests. Tested on Windows, Linux and Linux 64 bit
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
--TEST--
|
||||
Test date_default_timezone_get() function : error conditions
|
||||
--INI--
|
||||
date.timezone=UTC
|
||||
--FILE--
|
||||
<?php
|
||||
/* Prototype : string date_default_timezone_get ( void )
|
||||
* Description: Gets the default timezone used by all date/time functions in a script.
|
||||
* Source code: ext/standard/data/php_date.c
|
||||
*/
|
||||
|
||||
date_default_timezone_set("UTC");
|
||||
|
||||
echo "*** Testing date_default_timezone_get() : error conditions ***\n";
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
--TEST--
|
||||
Test date_default_timezone_set() function : error variations
|
||||
--INI--
|
||||
date.timezone=UTC
|
||||
--FILE--
|
||||
<?php
|
||||
/* Prototype : bool date_default_timezone_set ( string $timezone_identifier )
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
--TEST--
|
||||
Test date_sun_info() function : error variations
|
||||
--INI--
|
||||
date.timezone=UTC
|
||||
--FILE--
|
||||
<?php
|
||||
/* Prototype : array date_sun_info ( int $time , float $latitude , float $longitude )
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
--TEST--
|
||||
Test date_sun_info() function : error variations - Pass unexpected values for time argument
|
||||
--INI--
|
||||
date.timezone=UTC
|
||||
--FILE--
|
||||
<?php
|
||||
/* Prototype : array date_sun_info ( int $time , float $latitude , float $longitude )
|
||||
* Description: Returns an array with information about sunset/sunrise and twilight begin/end.
|
||||
* Source code: ext/standard/data/php_date.c
|
||||
*/
|
||||
|
||||
date_default_timezone_set("UTC");
|
||||
|
||||
echo "*** Testing date_sun_info() : usage variations ***\n";
|
||||
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
--TEST--
|
||||
Test date_sun_info() function : error variations - PAss unexepcted valuesfor latitude argument
|
||||
--INI--
|
||||
date.timezone=UTC
|
||||
--FILE--
|
||||
<?php
|
||||
/* Prototype : array date_sun_info ( int $time , float $latitude , float $longitude )
|
||||
* Description: Returns an array with information about sunset/sunrise and twilight begin/end.
|
||||
* Source code: ext/standard/data/php_date.c
|
||||
*/
|
||||
|
||||
// supress date() function strict msgs
|
||||
error_reporting(E_ALL & ~E_STRICT);
|
||||
|
||||
echo "*** Testing date_sun_info() : usage variations ***\n";
|
||||
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
--TEST--
|
||||
Test date_sun_info() function : usage variations - Pass unexpected values for longitude argument
|
||||
--INI--
|
||||
date.timezone=UTC
|
||||
--FILE--
|
||||
<?php
|
||||
/* Prototype : array date_sun_info ( int $time , float $latitude , float $longitude )
|
||||
* Description: Returns an array with information about sunset/sunrise and twilight begin/end.
|
||||
* Source code: ext/standard/data/php_date.c
|
||||
*/
|
||||
|
||||
// supress date() function strict msgs
|
||||
error_reporting(E_ALL & ~E_STRICT);
|
||||
|
||||
echo "*** Testing date_sun_info() : usage variations ***\n";
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
--TEST--
|
||||
Basic test for date_sunrise and date_sunset based on example in PHP manual
|
||||
--INI--
|
||||
date.timezone=UTC
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
@@ -14,8 +12,8 @@ offset: +1 GMT
|
||||
|
||||
echo "Basic test for date_sunrise() and date_sunset()\n";
|
||||
|
||||
// supress date() function warning msgs
|
||||
error_reporting(E_ALL & ~E_WARNING);
|
||||
// supress date() function strict msgs
|
||||
error_reporting(E_ALL & ~E_STRICT);
|
||||
|
||||
echo date("D M d Y") . ', sunrise time : ' . date_sunrise(time(), SUNFUNCS_RET_STRING, 38.4, -9, 90, 1) . "\n";
|
||||
echo date("D M d Y") . ', sunset time : ' . date_sunset(time(), SUNFUNCS_RET_STRING, 38.4, -9, 90, 1) . "\n";
|
||||
|
||||
Reference in New Issue
Block a user