MediaWiki  1.23.15
XMPValidateTest.php
Go to the documentation of this file.
1 <?php
3 
8  public function testValidateDate( $value, $expected ) {
9  // The method should modify $value.
11  $this->assertEquals( $expected, $value );
12  }
13 
14  public static function provideDates() {
15  /* For reference valid date formats are:
16  * YYYY
17  * YYYY-MM
18  * YYYY-MM-DD
19  * YYYY-MM-DDThh:mmTZD
20  * YYYY-MM-DDThh:mm:ssTZD
21  * YYYY-MM-DDThh:mm:ss.sTZD
22  * (Time zone is optional)
23  */
24  return array(
25  array( '1992', '1992' ),
26  array( '1992-04', '1992:04' ),
27  array( '1992-02-01', '1992:02:01' ),
28  array( '2011-09-29', '2011:09:29' ),
29  array( '1982-12-15T20:12', '1982:12:15 20:12' ),
30  array( '1982-12-15T20:12Z', '1982:12:15 20:12' ),
31  array( '1982-12-15T20:12+02:30', '1982:12:15 22:42' ),
32  array( '1982-12-15T01:12-02:30', '1982:12:14 22:42' ),
33  array( '1982-12-15T20:12:11', '1982:12:15 20:12:11' ),
34  array( '1982-12-15T20:12:11Z', '1982:12:15 20:12:11' ),
35  array( '1982-12-15T20:12:11+01:10', '1982:12:15 21:22:11' ),
36  array( '2045-12-15T20:12:11', '2045:12:15 20:12:11' ),
37  array( '1867-06-01T15:00:00', '1867:06:01 15:00:00' ),
38  /* some invalid ones */
39  array( '2001--12', null ),
40  array( '2001-5-12', null ),
41  array( '2001-5-12TZ', null ),
42  array( '2001-05-12T15', null ),
43  array( '2001-12T15:13', null ),
44  );
45  }
46 }
php
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
Definition: skin.txt:62
XMPValidateTest\provideDates
static provideDates()
Definition: XMPValidateTest.php:14
MediaWikiTestCase
Definition: MediaWikiTestCase.php:6
XMPValidateTest\testValidateDate
testValidateDate( $value, $expected)
@dataProvider provideDates @covers XMPValidate::validateDate
Definition: XMPValidateTest.php:8
array
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
$value
$value
Definition: styleTest.css.php:45
XMPValidateTest
Definition: XMPValidateTest.php:2
XMPValidate\validateDate
static validateDate( $info, &$val, $standalone)
function to validate date properties, and convert to (partial) Exif format.
Definition: XMPValidate.php:241