@@ -548,4 +548,48 @@ public function provideRedactFailsOnBadInput() : array
548548 ],
549549 ];
550550 }
551+
552+ /**
553+ * @param string $input The string value to be filtered.
554+ * @param string $expectedValue The expected filtered value.
555+ *
556+ * @test
557+ * @dataProvider provideStripEmoji
558+ */
559+ public function stripEmoji (string $ input , string $ expectedValue )
560+ {
561+ $ actualValue = Strings::stripEmoji ($ input );
562+ $ this ->assertSame ($ expectedValue , $ actualValue );
563+ }
564+
565+ /**
566+ * @return array
567+ */
568+ public static function provideStripEmoji (): array
569+ {
570+ return [
571+ 'mulitple emoji ' => [
572+ 'input ' => 'This 💩 text contains 😞 multiple emoji 🍔 characters 🍚. As well as an alphanumeric '
573+ . 'supplement 🆗 and flag 🚩 ' ,
574+ 'expected ' => 'This text contains multiple emoji characters . As well as an alphanumeric '
575+ . 'supplement and flag ' ,
576+ ],
577+ 'emoji ' => [
578+ 'input ' => '🙄 this is ridiculous ' ,
579+ 'expected ' => ' this is ridiculous ' ,
580+ ],
581+ 'alphanumeric supplement ' => [
582+ 'input ' => 'Contains a 🆗 character ' ,
583+ 'expected ' => 'Contains a character ' ,
584+ ],
585+ 'flag/transportation symbols ' => [
586+ 'input ' => 'Contains a 🚩 character ' ,
587+ 'expected ' => 'Contains a character ' ,
588+ ],
589+ 'dingbat symbols ' => [
590+ 'input ' => 'Contains a ❗ character ' ,
591+ 'expected ' => 'Contains a character ' ,
592+ ],
593+ ];
594+ }
551595}
0 commit comments