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