Skip to content

Commit a4c8303

Browse files
committed
Update InitTest.php
1 parent 4c847bc commit a4c8303

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

tests/InitTest.php

+3-13
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function testMatchAll()
2424

2525
$text = "a #💩 #and #🍦 #😳";
2626
$parser = new EmojiParser();
27-
$parser->setPrepend("#\\w+|#");
27+
$parser->setPrepend("#(?:[\\w]|");
2828
$matches = $parser->matchAll($text);
2929

3030
$this->assertNotEmpty($matches);
@@ -49,20 +49,10 @@ public function testMatchAll()
4949
$this->assertGreaterThan(0, preg_match("/^\#\xF0\x9F\x98\xB3$/", $matches[0][3]));
5050
}
5151

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-
6252
public function testReplaceCallback()
6353
{
6454
$parser = new EmojiParser();
65-
$parser->setPrepend("#\\w+|#");
55+
$parser->setPrepend("#(?:[\\w]|");
6656
$text = "a #💩 #and or #🍦 #😳";
6757
$i = 0;
6858
$matches = [];
@@ -90,4 +80,4 @@ public function testMatch(){
9080
$match = $parser->match($text);
9181
$this->assertGreaterThan(0, $match);
9282
}
93-
}
83+
}

0 commit comments

Comments
 (0)