-
Notifications
You must be signed in to change notification settings - Fork 0
/
parse_date_basic.phpt
53 lines (52 loc) · 1.25 KB
/
parse_date_basic.phpt
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
--TEST--
Test basic calculation test of the data model function, parse_date
--FILE--
<?php
require_once('DataModel.php');
$model = new DateModel();
echo "testing \$model->parse_date()\n";
var_dump($model->parse_date('April 26, 2017'));
var_dump($model->parse_date('today'));
var_dump($model->parse_date('2009-22-12'));
var_dump($model->parse_date('April 26, 2017 12:00'));
var_dump($model->parse_date('2009-22-12 12:00'));
var_dump($model->parse_date('r2-d2'));
var_dump($model->parse_date(''));
var_dump($model->parse_date(array()));
echo "Done\n";
?>
--EXPECTF--
testing model->parse_date()
array(1) {
["date"]=>
string(19) "2017-04-26 00:00:00"
}
array(1) {
["date"]=>
string(19) "2017-01-29 00:00:00"
}
array(1) {
["date"]=>
string(19) "2009-12-22 00:00:00"
}
array(1) {
["date"]=>
string(19) "2017-04-26 12:00:00"
}
array(1) {
["date"]=>
string(19) "2009-12-22 12:00:00"
}
array(1) {
["error"]=>
string(82) "<ul><li>Missing the year</li><li>Missing a month</li><li>Missing the day</li></ul>"
}
array(1) {
["error"]=>
string(82) "<ul><li>Missing the year</li><li>Missing a month</li><li>Missing the day</li></ul>"
}
array(1) {
["error"]=>
string(82) "<ul><li>Missing the year</li><li>Missing a month</li><li>Missing the day</li></ul>"
}
Done