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')); } }