dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Additional tests to keep Parsoid on track."
[lhc/web/wiklou.git]
/
tests
/
phpunit
/
includes
/
TimestampTest.php
diff --git
a/tests/phpunit/includes/TimestampTest.php
b/tests/phpunit/includes/TimestampTest.php
index
231228f
..
6352160
100644
(file)
--- a/
tests/phpunit/includes/TimestampTest.php
+++ b/
tests/phpunit/includes/TimestampTest.php
@@
-4,6
+4,16
@@
* Tests timestamp parsing and output.
*/
class TimestampTest extends MediaWikiTestCase {
* Tests timestamp parsing and output.
*/
class TimestampTest extends MediaWikiTestCase {
+
+ protected function setUp() {
+ parent::setUp();
+
+ $this->setMwGlobals( array(
+ 'wgLanguageCode' => 'en',
+ 'wgContLang' => Language::factory( 'en' ),
+ 'wgLang' => Language::factory( 'en' ),
+ ) );
+ }
/**
* Test parsing of valid timestamps and outputing to MW format.
* @dataProvider provideValidTimestamps
/**
* Test parsing of valid timestamps and outputing to MW format.
* @dataProvider provideValidTimestamps
@@
-44,14
+54,14
@@
class TimestampTest extends MediaWikiTestCase {
*/
function testHumanOutput() {
$timestamp = new MWTimestamp( time() - 3600 );
*/
function testHumanOutput() {
$timestamp = new MWTimestamp( time() - 3600 );
- $this->assertEquals( "1 hour ago", $timestamp->getHumanTimestamp()->
toString
() );
+ $this->assertEquals( "1 hour ago", $timestamp->getHumanTimestamp()->
inLanguage( 'en' )->text
() );
}
/**
* Returns a list of valid timestamps in the format:
* array( type, timestamp_of_type, timestamp_in_MW )
*/
}
/**
* Returns a list of valid timestamps in the format:
* array( type, timestamp_of_type, timestamp_in_MW )
*/
- function provideValidTimestamps() {
+
public static
function provideValidTimestamps() {
return array(
// Various formats
array( TS_UNIX, '1343761268', '20120731190108' ),
return array(
// Various formats
array( TS_UNIX, '1343761268', '20120731190108' ),