MediaWiki REL1_28
ConvertibleTimestampTest Class Reference

Tests timestamp parsing and output. More...

Inheritance diagram for ConvertibleTimestampTest:
Collaboration diagram for ConvertibleTimestampTest:

Public Member Functions

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

Static Public Member Functions

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

Detailed Description

Tests timestamp parsing and output.

Definition at line 6 of file ConvertibleTimestampTest.php.

Member Function Documentation

◆ provideOutOfRangeTimestamps()

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.

◆ provideValidTimestampDifferences()

static ConvertibleTimestampTest::provideValidTimestampDifferences ( )
static

Definition at line 25 of file ConvertibleTimestampTest.php.

◆ provideValidTimestamps()

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.

◆ testConstructWithNoTimestamp()

ConvertibleTimestampTest::testConstructWithNoTimestamp ( )

ConvertibleTimestamp::__construct.

Definition at line 10 of file ConvertibleTimestampTest.php.

References $timestamp, and TS_MW.

◆ testConvert()

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

provideValidTimestamps ConvertibleTimestamp::convert

Definition at line 78 of file ConvertibleTimestampTest.php.

References ConvertibleTimestamp\convert().

◆ testConvertInvalid()

ConvertibleTimestampTest::testConvertInvalid ( )

Format an invalid timestamp.

ConvertibleTimestamp::convert

Definition at line 86 of file ConvertibleTimestampTest.php.

References ConvertibleTimestamp\convert().

◆ testDiff()

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

provideValidTimestampDifferences ConvertibleTimestamp::diff

Definition at line 38 of file ConvertibleTimestampTest.php.

◆ testInvalidOutput()

ConvertibleTimestampTest::testInvalidOutput ( )

Test requesting an invalid output format.

TimestampException ConvertibleTimestamp::getTimestamp

Definition at line 106 of file ConvertibleTimestampTest.php.

References $timestamp.

◆ testInvalidParse()

ConvertibleTimestampTest::testInvalidParse ( )

Test an invalid timestamp.

TimestampException ConvertibleTimestamp

Definition at line 70 of file ConvertibleTimestampTest.php.

◆ testOutOfRangeTimestamps()

ConvertibleTimestampTest::testOutOfRangeTimestamps (   $format,
  $input 
)

Test an out of range timestamp provideOutOfRangeTimestamps TimestampException ConvertibleTimestamp.

Definition at line 96 of file ConvertibleTimestampTest.php.

References $timestamp.

◆ testToString()

ConvertibleTimestampTest::testToString ( )

◆ testValidOutput()

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.

◆ testValidParse()

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: