summaryrefslogtreecommitdiff
path: root/ext/calendar/tests/unixtojd_error1.phpt
blob: 6b8fad05ebd83881938ad8a7a945ab3c4800f3b9 (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>
--EXTENSIONS--
calendar
--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--
unixtojd(): Argument #1 ($timestamp) must be greater than or equal to 0
int(%d)
int(%d)
int(%d)