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 8
8
9
9
class Foo extends Regex
10
10
{
11
+ public $ description = 'Bar ' ;
12
+
11
13
/**
12
14
* Return the Regex that the values are validated against.
13
15
*
Original file line number Diff line number Diff line change @@ -19,6 +19,8 @@ public function regexClassProvider()
19
19
[
20
20
new class () extends Regex {
21
21
public $ name = 'Foo ' ;
22
+
23
+ public $ description = 'Bar ' ;
22
24
23
25
/**
24
26
* Return the Regex that the values are validated against.
@@ -33,11 +35,29 @@ protected function regex(): string
33
35
}
34
36
},
35
37
],
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
+ ],
36
56
[
37
57
new Foo (),
38
58
],
39
59
[
40
- Regex::make ('Foo ' , '/foo/ ' ),
60
+ Regex::make ('Foo ' , 'Bar ' , ' /foo/ ' ),
41
61
],
42
62
];
43
63
}
@@ -48,6 +68,7 @@ protected function regex(): string
48
68
public function testCreateNamedRegexClass (Regex $ regex )
49
69
{
50
70
$ this ->assertSame ('Foo ' , $ regex ->name );
71
+ $ this ->assertSame ('Bar ' , $ regex ->description );
51
72
}
52
73
53
74
/**
You can’t perform that action at this time.
0 commit comments