7 protected function setUp() {
26 $user = $this->createMock( User::class );
27 $user->expects( $this->
any() )
28 ->method(
'getOption' )
29 ->with(
'timecorrection' )
30 ->will( $this->returnValue( $timeCorrection ) );
32 $user->expects( $this->
any() )
33 ->method(
'getDatePreference' )
34 ->will( $this->returnValue( $dateFormat ) );
41 $tsTime->getHumanTimestamp( $currentTime, $user ),
54 '"Yesterday" across years',
93 '15:15, January 30, 1991',
101 'Yesterday at 23:00',
102 '"Yesterday" across years with time correction',
110 'Recent weekday with time correction',
118 'Today at another time with time correction',
126 'Another month with dmy'
134 'Another month with ISO-8601'
141 '1991-01-30T15:15:00',
142 'Different year with ISO-8601',
159 $user = $this->createMock( User::class );
160 $user->expects( $this->
any() )
161 ->method(
'getOption' )
162 ->with(
'timecorrection' )
163 ->will( $this->returnValue( $timeCorrection ) );
170 $tsTime->getRelativeTimestamp( $currentTime, $user ),
183 '"Yesterday" across years',
198 '6 minutes and 30 seconds ago',
199 'Combination of multiple units',
214 '2 decades, 1 year, 168 days, 2 hours, 8 minutes and 48 seconds ago',
223 '"Yesterday" across years with time correction',
231 'Recent weekday with time correction',
238 '9 hours and 17 minutes ago',
239 'Today at another time with time correction',
they could even be mouse clicks or menu items whatever suits your program You should also get your if any
Tests timestamp parsing and output.
testRelativeTimestamp( $tsTime, $currentTime, $timeCorrection, $dateFormat, $expectedOutput, $desc)
provideRelativeTimestampTests MWTimestamp::getRelativeTimestamp
static provideHumanTimestampTests()
testHumanTimestamp( $tsTime, $currentTime, $timeCorrection, $dateFormat, $expectedOutput, $desc)
provideHumanTimestampTests MWTimestamp::getHumanTimestamp
static provideRelativeTimestampTests()
Library for creating and parsing MW-style timestamps.