Skip to content

Commit

Permalink
Add further tests
Browse files Browse the repository at this point in the history
  • Loading branch information
u01jmg3 committed Oct 10, 2023
1 parent f8a672b commit 5bb6470
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions tests/CleanCharacterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,35 @@ protected static function getMethod($name)
return $method;
}

public function testCleanCharacters()
public function testCleanCharactersWithUnicodeCharacters()
{
$ical = new ICal();

self::assertSame(
'...',
self::getMethod('cleanCharacters')->invokeArgs($ical, array("\xe2\x80\xa6"))
);
}

public function testCleanCharactersWithEmojis()
{
$ical = new ICal();
$input = 'Test with emoji 🔴👍🏻';

self::assertSame(
self::getMethod('cleanCharacters')->invokeArgs($ical, array($input)),
$input
$input,
self::getMethod('cleanCharacters')->invokeArgs($ical, array($input))
);
}

public function testCleanCharactersWithWindowsCharacters()
{
$ical = new ICal();
$input = self::getMethod('mb_chr')->invokeArgs($ical, array(133));

self::assertSame(
'...',
self::getMethod('cleanCharacters')->invokeArgs($ical, array($input))
);
}
}

0 comments on commit 5bb6470

Please sign in to comment.