MediaWiki  1.28.0
ConvertibleTimestampTest Class Reference

Tests timestamp parsing and output. More...

Inheritance diagram for ConvertibleTimestampTest:
Collaboration diagram for ConvertibleTimestampTest:

Public Member Functions

 testConstructWithNoTimestamp ()
 ConvertibleTimestamp::__construct. More...
 
 testConvert ($format, $expected, $original)
 provideValidTimestamps ConvertibleTimestamp::convert More...
 
 testConvertInvalid ()
 Format an invalid timestamp. More...
 
 testDiff ($timestamp1, $timestamp2, $expected)
 provideValidTimestampDifferences ConvertibleTimestamp::diff More...
 
 testInvalidOutput ()
 Test requesting an invalid output format. More...
 
 testInvalidParse ()
 Test an invalid timestamp. More...
 
 testOutOfRangeTimestamps ($format, $input)
 Test an out of range timestamp provideOutOfRangeTimestamps TimestampException ConvertibleTimestamp. More...
 
 testToString ()
 ConvertibleTimestamp::__toString. More...
 
 testValidOutput ($format, $expected, $original)
 Test outputting valid timestamps to different formats. More...
 
 testValidParse ($format, $original, $expected)
 Test parsing of valid timestamps and outputing to MW format. More...
 

Static Public Member Functions

static provideOutOfRangeTimestamps ()
 Returns a list of out of range timestamps in the format: [ type, timestamp_of_type ]. More...
 
static provideValidTimestampDifferences ()
 
static provideValidTimestamps ()
 Returns a list of valid timestamps in the format: [ type, timestamp_of_type, timestamp_in_MW ]. More...
 

Detailed Description

Tests timestamp parsing and output.

Definition at line 6 of file ConvertibleTimestampTest.php.

Member Function Documentation

static ConvertibleTimestampTest::provideOutOfRangeTimestamps ( )
static

Returns a list of out of range timestamps in the format: [ type, timestamp_of_type ].

Definition at line 137 of file ConvertibleTimestampTest.php.

References TS_MW.

static ConvertibleTimestampTest::provideValidTimestampDifferences ( )
static

Definition at line 25 of file ConvertibleTimestampTest.php.

static ConvertibleTimestampTest::provideValidTimestamps ( )
static

Returns a list of valid timestamps in the format: [ type, timestamp_of_type, timestamp_in_MW ].

Definition at line 115 of file ConvertibleTimestampTest.php.

References TS_DB, TS_EXIF, TS_ISO_8601, TS_ISO_8601_BASIC, TS_MW, TS_ORACLE, TS_POSTGRES, TS_RFC2822, and TS_UNIX.

ConvertibleTimestampTest::testConstructWithNoTimestamp ( )

ConvertibleTimestamp::__construct.

Definition at line 10 of file ConvertibleTimestampTest.php.

References $timestamp, and TS_MW.

ConvertibleTimestampTest::testConvert (   $format,
  $expected,
  $original 
)

provideValidTimestamps ConvertibleTimestamp::convert

Definition at line 78 of file ConvertibleTimestampTest.php.

References ConvertibleTimestamp\convert().

ConvertibleTimestampTest::testConvertInvalid ( )

Format an invalid timestamp.

ConvertibleTimestamp::convert

Definition at line 86 of file ConvertibleTimestampTest.php.

References ConvertibleTimestamp\convert().

ConvertibleTimestampTest::testDiff (   $timestamp1,
  $timestamp2,
  $expected 
)

provideValidTimestampDifferences ConvertibleTimestamp::diff

Definition at line 38 of file ConvertibleTimestampTest.php.

ConvertibleTimestampTest::testInvalidOutput ( )

Test requesting an invalid output format.

TimestampException ConvertibleTimestamp::getTimestamp

Definition at line 106 of file ConvertibleTimestampTest.php.

References $timestamp.

ConvertibleTimestampTest::testInvalidParse ( )

Test an invalid timestamp.

TimestampException ConvertibleTimestamp

Definition at line 70 of file ConvertibleTimestampTest.php.

ConvertibleTimestampTest::testOutOfRangeTimestamps (   $format,
  $input 
)

Test an out of range timestamp provideOutOfRangeTimestamps TimestampException ConvertibleTimestamp.

Definition at line 96 of file ConvertibleTimestampTest.php.

References $timestamp.

ConvertibleTimestampTest::testToString ( )
ConvertibleTimestampTest::testValidOutput (   $format,
  $expected,
  $original 
)

Test outputting valid timestamps to different formats.

provideValidTimestamps ConvertibleTimestamp::getTimestamp

Definition at line 60 of file ConvertibleTimestampTest.php.

References $timestamp.

ConvertibleTimestampTest::testValidParse (   $format,
  $original,
  $expected 
)

Test parsing of valid timestamps and outputing to MW format.

provideValidTimestamps ConvertibleTimestamp::getTimestamp

Definition at line 50 of file ConvertibleTimestampTest.php.

References $timestamp, and TS_MW.


The documentation for this class was generated from the following file: