resourceloader: Consistently refer to the framework as ResourceLoader
[lhc/web/wiklou.git] / tests / phpunit / includes / MWTimestampTest.php
index 05c1a66..3656254 100644 (file)
@@ -81,6 +81,17 @@ class MWTimestampTest extends MediaWikiLangTestCase {
                new MWTimestamp( "This is not a timestamp." );
        }
 
+       /**
+        * Test an out of range timestamp
+        * @dataProvider provideOutOfRangeTimestamps
+        * @expectedException TimestampException
+        * @covers MWTimestamp
+        */
+       public function testOutOfRangeTimestamps( $format, $input ) {
+               $timestamp = new MWTimestamp( $input );
+               $timestamp->getTimestamp( $format );
+       }
+
        /**
         * Test requesting an invalid output format.
         * @expectedException TimestampException
@@ -113,6 +124,18 @@ class MWTimestampTest extends MediaWikiLangTestCase {
                );
        }
 
+       /**
+        * Returns a list of out of range timestamps in the format:
+        * array( type, timestamp_of_type )
+        */
+       public static function provideOutOfRangeTimestamps() {
+               return array(
+                       // Various formats
+                       array( TS_MW, '-62167219201' ), // -0001-12-31T23:59:59Z
+                       array( TS_MW, '253402300800' ), // 10000-01-01T00:00:00Z
+               );
+       }
+
        /**
         * @dataProvider provideHumanTimestampTests
         * @covers MWTimestamp::getHumanTimestamp