From 5b9801a5e8e14a0d620226d960d0aa935f69a663 Mon Sep 17 00:00:00 2001 From: "Theodore R. Smith" Date: Mon, 1 Apr 2024 11:13:51 -0500 Subject: [PATCH] Code review changes. --- src/Highlighter.php | 2 +- tests/HighlighterTest.php | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Highlighter.php b/src/Highlighter.php index af4048b..1a2f80c 100644 --- a/src/Highlighter.php +++ b/src/Highlighter.php @@ -52,7 +52,7 @@ public function __construct( } } - public function isSupportedLanguage(string $language): bool + public function hasLanguage(string $language): bool { return array_key_exists(strtolower($language), $this->languages); } diff --git a/tests/HighlighterTest.php b/tests/HighlighterTest.php index 28da2dc..97bad53 100644 --- a/tests/HighlighterTest.php +++ b/tests/HighlighterTest.php @@ -42,15 +42,15 @@ public static function data(): array ]; } - public function test_is_supported_language(): void + public function test_has_language(): void { $highlight = new Highlighter(); - self::assertTrue($highlight->isSupportedLanguage('php')); - self::assertTrue($highlight->isSupportedLanguage('PHP')); - self::assertTrue($highlight->isSupportedLanguage('Php')); + self::assertTrue($highlight->hasLanguage('php')); + self::assertTrue($highlight->hasLanguage('PHP')); + self::assertTrue($highlight->hasLanguage('Php')); - self::assertFalse($highlight->isSupportedLanguage('DoesNotExist')); - self::assertFalse($highlight->isSupportedLanguage('DOESNOTEXIST')); + self::assertFalse($highlight->hasLanguage('DoesNotExist')); + self::assertFalse($highlight->hasLanguage('DOESNOTEXIST')); } }