Added tests for new TS_ISO_8601_BASIC timestamp format added in r74043 (and fixed...
authorTrevor Parscal <tparscal@users.mediawiki.org>
Thu, 30 Sep 2010 21:58:32 +0000 (21:58 +0000)
committerTrevor Parscal <tparscal@users.mediawiki.org>
Thu, 30 Sep 2010 21:58:32 +0000 (21:58 +0000)
maintenance/tests/phpunit/includes/GlobalTest.php

index 75d229b..e41fbf1 100644 (file)
@@ -153,6 +153,10 @@ class GlobalTest extends PHPUnit_Framework_TestCase {
                        '2001-01-15 12:34:56',
                        wfTimestamp( TS_DB, $t ),
                        'TS_UNIX to TS_DB' );
+               $this->assertEquals(
+                       '20010115T123456Z',
+                       wfTimestamp( TS_ISO_8601_BASIC, $t ),
+                       'TS_ISO_8601_BASIC to TS_DB' );
 
                $this->assertEquals(
                        '20010115123456',
@@ -166,6 +170,10 @@ class GlobalTest extends PHPUnit_Framework_TestCase {
                        '2001-01-15 12:34:56',
                        wfTimestamp( TS_DB, '20010115123456' ),
                        'TS_MW to TS_DB' );
+               $this->assertEquals(
+                       '20010115T123456Z',
+                       wfTimestamp( TS_ISO_8601_BASIC, '20010115123456' ),
+                       'TS_MW to TS_ISO_8601_BASIC' );
 
                $this->assertEquals(
                        '20010115123456',
@@ -179,6 +187,10 @@ class GlobalTest extends PHPUnit_Framework_TestCase {
                        '2001-01-15 12:34:56',
                        wfTimestamp( TS_DB, '2001-01-15 12:34:56' ),
                        'TS_DB to TS_DB' );
+               $this->assertEquals(
+                       '20010115T123456Z',
+                       wfTimestamp( TS_ISO_8601_BASIC, '2001-01-15 12:34:56' ),
+                       'TS_DB to TS_ISO_8601_BASIC' );
        }
        
        function testBasename() {