@@ -24,7 +24,7 @@ public function testMatchAll()
24
24
25
25
$ text = "a #💩 #and #🍦 #😳 " ;
26
26
$ parser = new EmojiParser ();
27
- $ parser ->setPrepend ("# \\w+|# " );
27
+ $ parser ->setPrepend ("#(?:[ \\w]| " );
28
28
$ matches = $ parser ->matchAll ($ text );
29
29
30
30
$ this ->assertNotEmpty ($ matches );
@@ -49,20 +49,10 @@ public function testMatchAll()
49
49
$ this ->assertGreaterThan (0 , preg_match ("/^\# \xF0\x9F\x98\xB3$/ " , $ matches [0 ][3 ]));
50
50
}
51
51
52
- public function testPattern ()
53
- {
54
- $ parser = new EmojiParser ();
55
- $ pattern = $ parser ->getPattern (null );
56
-
57
- $ parser ->setPrepend ("# " );
58
- $ this ->assertEquals ("/# " .$ pattern ."/u " , $ parser ->getPattern ());
59
-
60
- }
61
-
62
52
public function testReplaceCallback ()
63
53
{
64
54
$ parser = new EmojiParser ();
65
- $ parser ->setPrepend ("# \\w+|# " );
55
+ $ parser ->setPrepend ("#(?:[ \\w]| " );
66
56
$ text = "a #💩 #and or #🍦 #😳 " ;
67
57
$ i = 0 ;
68
58
$ matches = [];
@@ -90,4 +80,4 @@ public function testMatch(){
90
80
$ match = $ parser ->match ($ text );
91
81
$ this ->assertGreaterThan (0 , $ match );
92
82
}
93
- }
83
+ }
0 commit comments