Skip to content

Commit

Permalink
Code review changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
hopeseekr committed Apr 1, 2024
1 parent cce3d57 commit 5b9801a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/Highlighter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
12 changes: 6 additions & 6 deletions tests/HighlighterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
}
}

0 comments on commit 5b9801a

Please sign in to comment.