Skip to content

Commit

Permalink
Fix some formatting in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Spirit55555 committed Oct 22, 2021
1 parent 96f0ed4 commit 336d1fc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/MinecraftColorsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@
final class MinecraftColorsTest extends TestCase {
public function testClean(): void {
$text = '§4Lorem §3§lipsum §rdolor &nsit &c&mamet';
$text_hex = "§#AA0000Lorem §3§lipsum §rdolor &nsit &#FF5555&kamet";
$text_hex = '§#AA0000Lorem §3§lipsum §rdolor &nsit &#FF5555&kamet';

$this->assertSame('Lorem ipsum dolor sit amet', MinecraftColors::clean($text));
$this->assertSame('Lorem ipsum dolor sit amet', MinecraftColors::clean($text_hex));
}

public function testConvertToHTML(): void {
$text = "§4Lorem §3§lipsum\n§rdolor &nsit &c&kamet";
$text_hex = "§#AA0000Lorem §3§lipsum\n§rdolor &nsit &#FF5555&kamet";
$text = '§4Lorem §3§lipsum\n§rdolor &nsit &c&kamet';
$text_hex = '§#AA0000Lorem §3§lipsum\n§rdolor &nsit &#FF5555&kamet';

$this->assertSame('<span style="color: #AA0000">Lorem </span><span style="color: #00AAAA"><span style="font-weight: bold;">ipsum</span></span>'."\n".'dolor <span style="text-decoration: underline;">sit </span><span style="color: #FF5555"><span class="minecraft-formatted--obfuscated">amet</span></span>', MinecraftColors::convertToHTML($text));
$this->assertSame('<span style="color: #AA0000">Lorem </span><span style="color: #00AAAA"><span style="font-weight: bold;">ipsum</span></span><br />dolor <span style="text-decoration: underline;">sit </span><span style="color: #FF5555"><span class="minecraft-formatted--obfuscated">amet</span></span>', MinecraftColors::convertToHTML($text, true));
Expand All @@ -52,7 +52,7 @@ public function testConvertToHTMLEmptyTags(): void {

public function testConvertToMOTD(): void {
$text = '§4Lorem §3§lipsum §rdolor &nsit &c&mamet';
$text_hex = "§#aa0000Lorem §3§lipsum §rdolor &nsit &#ff5555&mamet";
$text_hex = '§#aa0000Lorem §3§lipsum §rdolor &nsit &#ff5555&mamet';

$this->assertSame('\u00A74Lorem \u00A73\u00A7lipsum \u00A7rdolor \u00A7nsit \u00A7c\u00A7mamet', MinecraftColors::convertToMOTD($text));
$this->assertSame('&4Lorem &3&lipsum &rdolor &nsit &c&mamet', MinecraftColors::convertToMOTD($text, '&'));
Expand Down

0 comments on commit 336d1fc

Please sign in to comment.