File tree Expand file tree Collapse file tree 3 files changed +14
-4
lines changed
app/code/Magento/PageCache
Test/Unit/Controller/Block Expand file tree Collapse file tree 3 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -42,14 +42,14 @@ abstract class Block extends \Magento\Framework\App\Action\Action
42
42
private $ layoutCacheKeyName = 'mage_pagecache ' ;
43
43
44
44
/**
45
- * @var RegexFactory
45
+ * @var private RegexFactory
46
46
*/
47
47
private $ regexValidatorFactory ;
48
48
49
49
/**
50
50
* Validation pattern for handles array
51
51
*/
52
- public const VALIDATION_RULE_PATTERN = '/^[a-z]+[a-z0-9_]*$/i ' ;
52
+ private const VALIDATION_RULE_PATTERN = '/^[a-z]+[a-z0-9_]*$/i ' ;
53
53
54
54
/**
55
55
* @param \Magento\Framework\App\Action\Context $context
Original file line number Diff line number Diff line change @@ -66,6 +66,11 @@ class EsiTest extends TestCase
66
66
*/
67
67
protected $ translateInline ;
68
68
69
+ /**
70
+ * Validation pattern for handles array
71
+ */
72
+ private const VALIDATION_RULE_PATTERN = '/^[a-z]+[a-z0-9_]*$/i ' ;
73
+
69
74
/**
70
75
* Set up before test
71
76
*/
@@ -105,7 +110,7 @@ protected function setUp(): void
105
110
->setMethods (['create ' ])
106
111
->getMock ();
107
112
108
- $ regexObject = new Regex (' /^[a-z]+[a-z0-9_]*$/i ' );
113
+ $ regexObject = new Regex (self :: VALIDATION_RULE_PATTERN );
109
114
110
115
$ regexFactoryMock ->expects ($ this ->any ())->method ('create ' )
111
116
->willReturn ($ regexObject );
Original file line number Diff line number Diff line change @@ -71,6 +71,11 @@ class RenderTest extends TestCase
71
71
*/
72
72
protected $ layoutCacheKeyMock ;
73
73
74
+ /**
75
+ * Validation pattern for handles array
76
+ */
77
+ private const VALIDATION_RULE_PATTERN = '/^[a-z]+[a-z0-9_]*$/i ' ;
78
+
74
79
/**
75
80
* @inheritDoc
76
81
*/
@@ -118,7 +123,7 @@ protected function setUp(): void
118
123
->setMethods (['create ' ])
119
124
->getMock ();
120
125
121
- $ regexObject = new Regex (' /^[a-z]+[a-z0-9_]*$/i ' );
126
+ $ regexObject = new Regex (self :: VALIDATION_RULE_PATTERN );
122
127
123
128
$ regexFactoryMock ->expects ($ this ->any ())->method ('create ' )
124
129
->willReturn ($ regexObject );
You can’t perform that action at this time.
0 commit comments