Skip to content

Commit

Permalink
Rename the option from dash to hyphen
Browse files Browse the repository at this point in the history
  • Loading branch information
abrain committed Mar 21, 2021
1 parent 292dc1f commit 7d448a6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/ReportNumberController.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public function formatEinsatznummer(string $jahr, int $nummer): string
case 'slash':
$separator = '/';
break;
case 'dash':
case 'hyphen':
$separator = '-';
break;
default:
Expand Down Expand Up @@ -151,7 +151,7 @@ public static function sanitizeNumberOfDigits($input): int
*/
public static function sanitizeSeparator(string $input): string
{
if (in_array($input, ['none', 'slash', 'dash'])) {
if (in_array($input, ['none', 'slash', 'hyphen'])) {
return $input;
}

Expand Down
2 changes: 1 addition & 1 deletion src/Settings/Pages/Numbers.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public function echoFieldSeparator()
$this->echoRadioButtons('einsatzvw_numbers_separator', [
'none' => ['label' => _x('None', 'number separator selection', 'einsatzverwaltung')],
'slash' => ['label' => __('Slash', 'einsatzverwaltung'), 'code' => '/'],
'dash' => ['label' => __('Dash', 'einsatzverwaltung'), 'code' => '-'],
'hyphen' => ['label' => __('Hyphen', 'einsatzverwaltung'), 'code' => '-'],
], ReportNumberController::DEFAULT_SEPARATOR);
echo '</fieldset>';
printf(
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/ReportNumberControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function testSanitizeSeparator()
$fallback = ReportNumberController::DEFAULT_SEPARATOR;
self::assertEquals('none', ReportNumberController::sanitizeSeparator('none'));
self::assertEquals('slash', ReportNumberController::sanitizeSeparator('slash'));
self::assertEquals('dash', ReportNumberController::sanitizeSeparator('dash'));
self::assertEquals('hyphen', ReportNumberController::sanitizeSeparator('hyphen'));
self::assertEquals($fallback, ReportNumberController::sanitizeSeparator(''));
self::assertEquals($fallback, ReportNumberController::sanitizeSeparator('something'));
}
Expand Down Expand Up @@ -95,7 +95,7 @@ public function testFormatEinsatznummer()

expect('get_option')->once()->with('einsatzvw_einsatznummer_stellen')->andReturn('2');
expect('get_option')->once()->with('einsatzvw_einsatznummer_lfdvorne', false)->andReturn('0');
expect('get_option')->once()->with('einsatzvw_numbers_separator', 'none')->andReturn('dash');
expect('get_option')->once()->with('einsatzvw_numbers_separator', 'none')->andReturn('hyphen');
self::assertEquals('2019-623', $controller->formatEinsatznummer('2019', 623));
}
}

0 comments on commit 7d448a6

Please sign in to comment.