com php-src: added a test for date_interval_format functi on: ext/date/tests/date_interval_format.phpt
| From: | Joe Watkins | Date: | Sat, 12 Nov 2016 09:57:50 +0000 |
| Subject: | com php-src: added a test for date_interval_format functi on: ext/date/tests/date_interval_format.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-95713@lists.php.net to get a copy of this message | ||
Commit: f578ce3a13f8ea6147e8ff92cde4470a522fd619
Author: Jean Carlo Machado <contato@jeancarlomachado.com.br> Thu, 27 Oct 2016
17:05:47 -0200
Committer: Joe Watkins <krakjoe@php.net> Sat, 12 Nov 2016 09:57:50 +0000
Parents: ff1986e4d7be8aaf0c63cf3ac64e67464a209653
Branches: PHP-7.0
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=f578ce3a13f8ea6147e8ff92cde4470a522fd619
Log:
added a test for date_interval_format function
Changed paths:
A ext/date/tests/date_interval_format.phpt
Diff:
diff --git a/ext/date/tests/date_interval_format.phpt b/ext/date/tests/date_interval_format.phpt
new file mode 100644
index 0000000..768fe46
--- /dev/null
+++ b/ext/date/tests/date_interval_format.phpt
@@ -0,0 +1,21 @@
+--TEST--
+Test date_interval_format() function : basic functionality
+--CREDITS--
+Jean Carlo Machado <contato@jeancarlomachado.com.br>
+--INI--
+date.timezone=UTC
+--FILE--
+<?php
+
+$interval = new DateInterval('P2Y4DT6H8M');
+echo date_interval_format($interval, '%d days');
+
+echo PHP_EOL;
+
+$interval = new DateInterval('P32D');
+echo date_interval_format($interval, '%d days');
+
+?>
+--EXPECTF--
+4 days
+32 days