Skip to content

Commit

Permalink
chore: add return type void to a bunch of test methods
Browse files Browse the repository at this point in the history
  • Loading branch information
blacknell committed Dec 27, 2021
1 parent 0c084e8 commit 3b5aaa5
Show file tree
Hide file tree
Showing 11 changed files with 65 additions and 65 deletions.
10 changes: 5 additions & 5 deletions tests/unit/Moment/MomentBritishEnglishLocaleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public function setUp(): void
Moment::setLocale('en_GB');
}

public function testWeekdayNames()
public function testWeekdayNames(): void
{
$startingDate = '2015-01-04T00:00:00+0000';

Expand All @@ -39,7 +39,7 @@ public function testWeekdayNames()
}
}

public function testMonthNames()
public function testMonthNames(): void
{
$startingDate = '2015-01-04T00:00:00+0000';

Expand Down Expand Up @@ -68,7 +68,7 @@ public function testMonthNames()
}
}

public function testFormat()
public function testFormat(): void
{
$a = array(
array('l, d F Y, G:i:s', 'Saturday, 12 June 2010, 22:00:00'),
Expand Down Expand Up @@ -105,15 +105,15 @@ public function testFormat()
// }
// }

public function testOrdinalsFormat()
public function testOrdinalsFormat(): void
{
$moment = new Moment('2010-06-02T00:00:00+0000');
self::assertEquals('2nd', $moment->format('jS'));
$moment = new Moment('2010-06-12T00:00:00+0000');
self::assertEquals('12th', $moment->format('jS'));
}

public function testRelative()
public function testRelative(): void
{
Moment::setLocale('en_GB');

Expand Down
12 changes: 6 additions & 6 deletions tests/unit/Moment/MomentCanadianEnglishLocaleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function setUp(): void
Moment::setLocale('en_CA');
}

public function testWeekdayNames()
public function testWeekdayNames(): void
{
$startingDate = '2015-01-04T00:00:00+0000';

Expand All @@ -48,7 +48,7 @@ public function testWeekdayNames()
}
}

public function testMonthNames()
public function testMonthNames(): void
{
$startingDate = '2015-01-04T00:00:00+0000';

Expand Down Expand Up @@ -77,7 +77,7 @@ public function testMonthNames()
}
}

public function testFormat()
public function testFormat(): void
{
$a = array(
array('l, d F Y, G:i:s', 'Saturday, 12 June 2010, 22:00:00'),
Expand All @@ -93,7 +93,7 @@ public function testFormat()
}
}

public function testCustomLocaleFormat()
public function testCustomLocaleFormat(): void
{
$a = array(
array('LT', '10:00 PM',),
Expand All @@ -114,15 +114,15 @@ public function testCustomLocaleFormat()
}
}

public function testOrdinalsFormat()
public function testOrdinalsFormat(): void
{
$moment = new Moment('2010-06-02T00:00:00+0000');
self::assertEquals('2nd', $moment->format('jS'));
$moment = new Moment('2010-06-12T00:00:00+0000');
self::assertEquals('12th', $moment->format('jS'));
}

public function testRelative()
public function testRelative(): void
{
$beginningMoment = new Moment('2010-06-12 00:00:00', 'Europe/London');

Expand Down
10 changes: 5 additions & 5 deletions tests/unit/Moment/MomentCanadianFrenchLocaleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function setUp(): void
Moment::setLocale('fr_CA');
}

public function testWeekdayNames()
public function testWeekdayNames(): void
{
$startingDate = '2015-01-04T00:00:00+0000';

Expand All @@ -48,7 +48,7 @@ public function testWeekdayNames()
}
}

public function testMonthNames()
public function testMonthNames(): void
{
$startingDate = '2015-01-04T00:00:00+0000';

Expand Down Expand Up @@ -78,7 +78,7 @@ public function testMonthNames()
}
}

public function testFormat()
public function testFormat(): void
{
$a = array(
array('l, F d Y, g:i:s a', 'dimanche, février 14 2010, 3:25:50 pm'),
Expand All @@ -94,15 +94,15 @@ public function testFormat()
}
}

public function testOrdinalsFormat()
public function testOrdinalsFormat(): void
{
$moment = new Moment('2010-06-02T00:00:00+0000');
self::assertEquals('2', $moment->format('jS'));
$moment = new Moment('2010-06-01T00:00:00+0000');
self::assertEquals('1er', $moment->format('jS'));
}

public function testRelative()
public function testRelative(): void
{
$beginningMoment = new Moment('2015-06-14 20:46:22', 'Europe/Berlin');
$endMoment = new Moment('2015-06-14 20:48:32', 'Europe/Berlin');
Expand Down
10 changes: 5 additions & 5 deletions tests/unit/Moment/MomentEsperantoLocaleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public function setUp(): void
Moment::setLocale('eo');
}

public function testWeekdayNames()
public function testWeekdayNames(): void
{
$startingDate = '2015-01-04T00:00:00+0000';

Expand All @@ -35,7 +35,7 @@ public function testWeekdayNames()
}
}

public function testMonthNames()
public function testMonthNames(): void
{
$startingDate = '2015-01-04T00:00:00+0000';

Expand Down Expand Up @@ -64,7 +64,7 @@ public function testMonthNames()
}
}

public function testFormat()
public function testFormat(): void
{
$targetDate = new Moment('2010-06-09 15:25:50');
$formats = array(
Expand All @@ -82,15 +82,15 @@ public function testFormat()
}
}

public function _testRelative()
public function _testRelative(): void
{
$beginningMoment = new Moment('2015-06-14 20:46:22', 'Europe/Berlin');
$endMoment = new Moment('2015-06-14 20:48:32', 'Europe/Berlin');
self::assertEquals('post 2 minutoj', $endMoment->from($beginningMoment)->getRelative());
self::assertEquals('antaŭ 2 minutoj', $beginningMoment->from($endMoment)->getRelative());
}

public function testRelative()
public function testRelative(): void
{
$tz = 'Europe/Berlin';
$beginningMoment = new Moment('2010-06-12 00:00:00', $tz);
Expand Down
8 changes: 4 additions & 4 deletions tests/unit/Moment/MomentFrenchLocaleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public function setUp(): void
Moment::setLocale('fr_FR');
}

public function testWeekdayNames()
public function testWeekdayNames(): void
{
$startingDate = '2015-01-04T00:00:00+0000';

Expand All @@ -36,7 +36,7 @@ public function testWeekdayNames()
}
}

public function testMonthNames()
public function testMonthNames(): void
{
$startingDate = '2015-01-04T00:00:00+0000';

Expand Down Expand Up @@ -66,7 +66,7 @@ public function testMonthNames()
}
}

public function testFormat()
public function testFormat(): void
{
$a = array(
array('l, F d Y, g:i:s a', 'dimanche, février 14 2010, 3:25:50 pm'),
Expand All @@ -82,7 +82,7 @@ public function testFormat()
}
}

public function testRelative()
public function testRelative(): void
{
$beginningMoment = new Moment('2015-06-14 20:46:22', 'Europe/Berlin');
$endMoment = new Moment('2015-06-14 20:48:32', 'Europe/Berlin');
Expand Down
10 changes: 5 additions & 5 deletions tests/unit/Moment/MomentGermanLocaleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public function setUp(): void
Moment::setLocale('de_DE');
}

public function testWeekdayNames()
public function testWeekdayNames(): void
{
$startingDate = '2015-01-04T00:00:00+0000';

Expand All @@ -36,7 +36,7 @@ public function testWeekdayNames()
}
}

public function testMonthNames()
public function testMonthNames(): void
{
$startingDate = '2015-01-04T00:00:00+0000';

Expand Down Expand Up @@ -66,7 +66,7 @@ public function testMonthNames()
}
}

public function testHirbodIssueLocaleDate001()
public function testHirbodIssueLocaleDate001(): void
{
// @see: https://github.com/fightbulc/moment.php/issues/50

Expand All @@ -79,15 +79,15 @@ public function testHirbodIssueLocaleDate001()
self::assertEquals('08. März', $moment->format('d. F'));
}

public function testHirbodIssueLocaleDate002()
public function testHirbodIssueLocaleDate002(): void
{
// @see: https://github.com/fightbulc/moment.php/issues/61

$moment = new Moment('2016-01-03 16:17:07', 'Europe/Berlin');
self::assertEquals('03. Dezember', $moment->subtractMonths(1)->format('d. F'));
}

public function testMonthsNominativeFallback()
public function testMonthsNominativeFallback(): void
{
$moment = new Moment('2016-01-03 16:17:07', 'Europe/Berlin');
self::assertEquals('Januar 2016', $moment->format('f Y'));
Expand Down
16 changes: 8 additions & 8 deletions tests/unit/Moment/MomentLatvianLocaleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public function setUp(): void
Moment::setLocale('lv_LV');
}

public function testWeekdayNames()
public function testWeekdayNames(): void
{
$startingDate = '2017-10-20T00:00:00+0000';

Expand Down Expand Up @@ -46,7 +46,7 @@ public function testWeekdayNames()
}
}

public function testMonthFormat()
public function testMonthFormat(): void
{
$startingDate = '2016-01-01T00:00:00+0000';

Expand Down Expand Up @@ -94,7 +94,7 @@ public function testMonthFormat()
}
}

public function testDayMonthFormat001()
public function testDayMonthFormat001(): void
{
$string = '2015-06-14 20:46:22';
$moment = new Moment($string, 'Europe/Riga');
Expand All @@ -105,15 +105,15 @@ public function testDayMonthFormat001()
self::assertEquals('8 Martā', $moment->format('j F'));
}

public function testMinutes()
public function testMinutes(): void
{
$past = new Moment('2016-01-03 16:17:07', 'Europe/Riga');

$relative = $past->from('2016-01-03 16:34:07');
self::assertEquals('pirms 17 minūtēm', $relative->getRelative());
}

public function testShowRelativeCalendarDates()
public function testShowRelativeCalendarDates(): void
{
$past = new Moment('2016-04-10 16:30:07');
self::assertEquals('Pagājušā Svētdiena plkst. 16:30', $past->calendar(true, new Moment('2016-04-12')));
Expand All @@ -137,7 +137,7 @@ public function testShowRelativeCalendarDates()
self::assertEquals('15.04.2116', $past->calendar(false, new Moment('2017-04-23')));
}

public function testFutureRelative()
public function testFutureRelative(): void
{
$date = new Moment('2017-01-11 01:00:00');

Expand All @@ -153,7 +153,7 @@ public function testFutureRelative()
self::assertEquals('pēc 7 gadiem', $date->from('2010-01-11 00:00:00')->getRelative(), 'year');
}

public function testPastRelative()
public function testPastRelative(): void
{
$date = new Moment('2010-01-11 01:00:00');
self::assertEquals('pirms dažām sekundēm', $date->from('2010-01-11 01:00:01')->getRelative(), 'seconds');
Expand All @@ -168,7 +168,7 @@ public function testPastRelative()
self::assertEquals('pirms 5 gadiem', $date->from('2015-01-11 01:00:00')->getRelative(), 'year');
}

public function testOrdinalFormat()
public function testOrdinalFormat(): void
{
$date = new Moment('2017-01-01 01:00:00', 'Europe/Riga');
self::assertEquals('1. Janvāris 2017', $date->format('jS f Y'));
Expand Down
12 changes: 6 additions & 6 deletions tests/unit/Moment/MomentPolishLocaleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public function setUp(): void
Moment::setLocale('pl_PL');
}

public function testWeekdayNames()
public function testWeekdayNames(): void
{
$startingDate = '2016-01-29T00:00:00+0000';

Expand All @@ -35,7 +35,7 @@ public function testWeekdayNames()
}
}

public function testDayMonthFormat001()
public function testDayMonthFormat001(): void
{
$string = '2015-06-14 20:46:22';
$moment = new Moment($string, 'Europe/Berlin');
Expand All @@ -46,13 +46,13 @@ public function testDayMonthFormat001()
self::assertEquals('8 marca', $moment->format('j F'));
}

public function testDayMonthFormat002()
public function testDayMonthFormat002(): void
{
$moment = new Moment('2016-01-03 16:17:07', 'Europe/Berlin');
self::assertEquals('3 grudnia', $moment->subtractMonths(1)->format('j F'));
}

public function testMonthFormatFN()
public function testMonthFormatFN(): void
{
$startingDate = '2016-01-01T00:00:00+0000';

Expand Down Expand Up @@ -81,7 +81,7 @@ public function testMonthFormatFN()
}


public function testMinutes()
public function testMinutes(): void
{
$past = new Moment('2016-01-03 16:17:07', 'Europe/Berlin');

Expand All @@ -95,7 +95,7 @@ public function testMinutes()
self::assertEquals('13 minut temu', $relative->getRelative());
}

public function testLastWeekWeekend()
public function testLastWeekWeekend(): void
{
$past = new Moment('2016-04-10');
self::assertEquals('ostatnia niedziela', $past->calendar(false, new Moment('2016-04-12')));
Expand Down
Loading

0 comments on commit 3b5aaa5

Please sign in to comment.