Skip to content
Snippets Groups Projects
Commit 7360787e authored by Bohdan Korablov's avatar Bohdan Korablov
Browse files

MAGETWO-62491: [PR] Delivery of stories (sprint 3)

parent f6bf2a25
No related merge requests found
...@@ -71,6 +71,6 @@ class Environment implements PlaceholderInterface ...@@ -71,6 +71,6 @@ class Environment implements PlaceholderInterface
*/ */
public function isApplicable($placeholder) public function isApplicable($placeholder)
{ {
return 1 === preg_match('/(' . static::PREFIX . '.*[a-zA-Z_]).*/', $placeholder); return 1 === preg_match('/^' . static::PREFIX . '([a-zA-Z]+)([a-zA-Z0-9_])*$/', $placeholder);
} }
} }
...@@ -84,8 +84,8 @@ class EnvironmentTest extends \PHPUnit_Framework_TestCase ...@@ -84,8 +84,8 @@ class EnvironmentTest extends \PHPUnit_Framework_TestCase
public function testIsApplicable($placeholder, $expected) public function testIsApplicable($placeholder, $expected)
{ {
$this->assertSame( $this->assertSame(
$this->model->isApplicable($placeholder), $expected,
$expected $this->model->isApplicable($placeholder)
); );
} }
...@@ -98,6 +98,9 @@ class EnvironmentTest extends \PHPUnit_Framework_TestCase ...@@ -98,6 +98,9 @@ class EnvironmentTest extends \PHPUnit_Framework_TestCase
[Environment::PREFIX . 'TEST', true], [Environment::PREFIX . 'TEST', true],
['TEST', false], ['TEST', false],
[Environment::PREFIX . 'TEST_test', true], [Environment::PREFIX . 'TEST_test', true],
[Environment::PREFIX . '-:A', false],
[Environment::PREFIX . '_A', false],
[Environment::PREFIX . 'A@#$', false]
]; ];
} }
} }
...@@ -192,7 +192,7 @@ class CrontabManager implements CrontabManagerInterface ...@@ -192,7 +192,7 @@ class CrontabManager implements CrontabManagerInterface
{ {
if (stripos(PHP_OS, 'WIN') === 0) { if (stripos(PHP_OS, 'WIN') === 0) {
throw new LocalizedException( throw new LocalizedException(
new Phrase('Your operation system is not supported, you cannot work with crontab') new Phrase('Your operation system is not supported to work with this command')
); );
} }
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment