File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
tests/unit/Codeception/Util Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -62,6 +62,18 @@ public function testRegexFilter()
62
62
$ this ->assertTrue ($ jsonType ->matches (['numbers ' => 'string:regex(~1-2-3~) ' ]));
63
63
$ this ->assertTrue ($ jsonType ->matches (['numbers ' => 'string:regex(~\d-\d-\d~) ' ]));
64
64
$ this ->assertNotTrue ($ jsonType ->matches (['numbers ' => 'string:regex(~^\d-\d$~) ' ]));
65
+
66
+ $ jsonType = new JsonType (['published ' => 1 ]);
67
+ $ this ->assertTrue ($ jsonType ->matches (['published ' => 'integer:regex(~1~) ' ]));
68
+ $ this ->assertTrue ($ jsonType ->matches (['published ' => 'integer:regex(~1|2~) ' ]));
69
+ $ this ->assertTrue ($ jsonType ->matches (['published ' => 'integer:regex(~2|1~) ' ]));
70
+ $ this ->assertNotTrue ($ jsonType ->matches (['published ' => 'integer:regex(~2~) ' ]));
71
+ $ this ->assertNotTrue ($ jsonType ->matches (['published ' => 'integer:regex(~2|3~) ' ]));
72
+ $ this ->assertNotTrue ($ jsonType ->matches (['published ' => 'integer:regex(~3|2~) ' ]));
73
+
74
+ $ jsonType = new JsonType (['date ' => '2011-11-30T04:06:44Z ' ]);
75
+ $ this ->assertTrue ($ jsonType ->matches (['date ' => 'string:regex(~2011-11-30T04:06:44Z|2011-11-30T05:07:00Z~) ' ]));
76
+ $ this ->assertNotTrue ($ jsonType ->matches (['date ' => 'string:regex(~2015-11-30T04:06:44Z|2016-11-30T05:07:00Z~) ' ]));
65
77
}
66
78
67
79
public function testDateTimeFilter ()
@@ -135,4 +147,4 @@ public function testNull()
135
147
]));
136
148
137
149
}
138
- }
150
+ }
You can’t perform that action at this time.
0 commit comments