File tree Expand file tree Collapse file tree 3 files changed +7
-4
lines changed
Test/Unit/Model/Placeholder
lib/internal/Magento/Framework/Crontab Expand file tree Collapse file tree 3 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -71,6 +71,6 @@ public function restore($template)
71
71
*/
72
72
public function isApplicable ($ placeholder )
73
73
{
74
- return 1 === preg_match ('/( ' . static ::PREFIX . '.* [a-zA-Z_]).* / ' , $ placeholder );
74
+ return 1 === preg_match ('/^ ' . static ::PREFIX . '( [a-zA-Z]+)([a-zA-Z0-9_])*$ / ' , $ placeholder );
75
75
}
76
76
}
Original file line number Diff line number Diff line change @@ -84,8 +84,8 @@ public function getGenerateDataProvider()
84
84
public function testIsApplicable ($ placeholder , $ expected )
85
85
{
86
86
$ this ->assertSame (
87
- $ this -> model -> isApplicable ( $ placeholder ) ,
88
- $ expected
87
+ $ expected ,
88
+ $ this -> model -> isApplicable ( $ placeholder )
89
89
);
90
90
}
91
91
@@ -98,6 +98,9 @@ public function getIsPlaceholderDataProvider()
98
98
[Environment::PREFIX . 'TEST ' , true ],
99
99
['TEST ' , false ],
100
100
[Environment::PREFIX . 'TEST_test ' , true ],
101
+ [Environment::PREFIX . '-:A ' , false ],
102
+ [Environment::PREFIX . '_A ' , false ],
103
+ [Environment::PREFIX . 'A@#$ ' , false ]
101
104
];
102
105
}
103
106
}
Original file line number Diff line number Diff line change @@ -192,7 +192,7 @@ private function checkSupportedOs()
192
192
{
193
193
if (stripos (PHP_OS , 'WIN ' ) === 0 ) {
194
194
throw new LocalizedException (
195
- new Phrase ('Your operation system is not supported, you cannot work with crontab ' )
195
+ new Phrase ('Your operation system is not supported to work with this command ' )
196
196
);
197
197
}
198
198
}
You can’t perform that action at this time.
0 commit comments