@@ -51,6 +51,24 @@ public function test_negative_match_description($value, $pattern, $error)
5151 $ this ->assertEquals ($ error , $ matcher ->getError ());
5252 }
5353
54+ /**
55+ * @dataProvider positiveRegexMatchData
56+ */
57+ public function test_positive_regex_matches ($ value , $ pattern )
58+ {
59+ $ matcher = new ExpressionMatcher ();
60+ $ this ->assertTrue ($ matcher ->match ($ value , $ pattern ));
61+ }
62+
63+ /**
64+ * @dataProvider negativeRegexMatchData
65+ */
66+ public function test_negative_regex_matches ($ value , $ pattern )
67+ {
68+ $ matcher = new ExpressionMatcher ();
69+ $ this ->assertFalse ($ matcher ->match ($ value , $ pattern ));
70+ }
71+
5472 public static function positiveCanMatchData ()
5573 {
5674 return array (
@@ -98,4 +116,20 @@ public static function negativeMatchDescription()
98116 ),
99117 );
100118 }
119+
120+ public static function positiveRegexMatchData ()
121+ {
122+ return array (
123+ array ('Cakper ' , 'expr(value matches "/Cakper/") ' ),
124+ array ('Cakper ' , 'expr(not(value matches "/Yaboomaster/")) ' ),
125+ );
126+ }
127+
128+ public static function negativeRegexMatchData ()
129+ {
130+ return array (
131+ array ('Cakper ' , 'expr(not(value matches "/Cakper/")) ' ),
132+ array ('Cakper ' , 'expr(value matches "/Yaboomaster/") ' ),
133+ );
134+ }
101135}
0 commit comments