File tree Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Original file line number Diff line number Diff line change 88
99class Foo extends Regex
1010{
11+ public $ description = 'Bar ' ;
12+
1113 /**
1214 * Return the Regex that the values are validated against.
1315 *
Original file line number Diff line number Diff line change @@ -19,6 +19,8 @@ public function regexClassProvider()
1919 [
2020 new class () extends Regex {
2121 public $ name = 'Foo ' ;
22+
23+ public $ description = 'Bar ' ;
2224
2325 /**
2426 * Return the Regex that the values are validated against.
@@ -33,11 +35,29 @@ protected function regex(): string
3335 }
3436 },
3537 ],
38+ [
39+ new class ([
40+ 'name ' => 'Foo ' ,
41+ 'description ' => 'Bar ' ,
42+ ]) extends Regex {
43+ /**
44+ * Return the Regex that the values are validated against.
45+ *
46+ * Must be a valid
47+ *
48+ * @return string
49+ */
50+ protected function regex (): string
51+ {
52+ return '/foo/ ' ;
53+ }
54+ },
55+ ],
3656 [
3757 new Foo (),
3858 ],
3959 [
40- Regex::make ('Foo ' , '/foo/ ' ),
60+ Regex::make ('Foo ' , 'Bar ' , ' /foo/ ' ),
4161 ],
4262 ];
4363 }
@@ -48,6 +68,7 @@ protected function regex(): string
4868 public function testCreateNamedRegexClass (Regex $ regex )
4969 {
5070 $ this ->assertSame ('Foo ' , $ regex ->name );
71+ $ this ->assertSame ('Bar ' , $ regex ->description );
5172 }
5273
5374 /**
You can’t perform that action at this time.
0 commit comments