summaryrefslogtreecommitdiff
path: root/ext/calendar/tests/unixtojd_error1.phpt
blob: 856fc1bcf43a4b487f28c1fd42f0e6a871dbcbea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
--TEST--
Test unixtojd() function : error conditions
--CREDITS--
edgarsandi - <edgar.r.sandi@gmail.com>
--SKIPIF--
<?php include 'skipif.inc'; ?>
--INI--
date.timezone=UTC
--FILE--
<?php
putenv('TZ=UTC');

try {
    unixtojd(-1);
} catch (ValueError $ex) {
    echo $ex->getMessage(), PHP_EOL;
}
var_dump(unixtojd(false)) . PHP_EOL;
var_dump(unixtojd(null)) . PHP_EOL;
var_dump(unixtojd(time())) . PHP_EOL;
?>
--EXPECTF--
Timestamp must not be negative
int(%d)
int(%d)
int(%d)