mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-03-18 23:49:55 +00:00
Fixing some shell tests when that fail when they are run in window
This commit is contained in:
parent
f4aeb514e3
commit
d54f8dc07a
2 changed files with 5 additions and 6 deletions
|
@ -191,13 +191,12 @@ class TestTask extends BakeTask {
|
||||||
public function getClassName($objectType) {
|
public function getClassName($objectType) {
|
||||||
$type = strtolower($objectType);
|
$type = strtolower($objectType);
|
||||||
if ($this->plugin) {
|
if ($this->plugin) {
|
||||||
$path = Inflector::pluralize($type);
|
|
||||||
if ($type === 'helper') {
|
if ($type === 'helper') {
|
||||||
$path = 'View/Helper';
|
$type = 'View/Helper';
|
||||||
} elseif ($type === 'component') {
|
} elseif ($type === 'component') {
|
||||||
$path = 'Controller/Component';
|
$type = 'Controller/Component';
|
||||||
} elseif ($type === 'behavior') {
|
} elseif ($type === 'behavior') {
|
||||||
$path = 'Model/Behavior';
|
$type = 'Model/Behavior';
|
||||||
}
|
}
|
||||||
$plugin = $this->plugin . '.';
|
$plugin = $this->plugin . '.';
|
||||||
$options = App::objects($plugin . $type);
|
$options = App::objects($plugin . $type);
|
||||||
|
@ -436,7 +435,7 @@ class TestTask extends BakeTask {
|
||||||
if (!$this->interactive) {
|
if (!$this->interactive) {
|
||||||
$className = $this->getRealClassName($type, $className);
|
$className = $this->getRealClassName($type, $className);
|
||||||
}
|
}
|
||||||
return $path . Inflector::camelize($className) . 'Test.php';
|
return str_replace('/', DS, $path) . Inflector::camelize($className) . 'Test.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -572,7 +572,7 @@ class TestTaskTest extends CakeTestCase {
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function testTestCaseFileName() {
|
public function testTestCaseFileName() {
|
||||||
$this->Task->path = '/my/path/tests/';
|
$this->Task->path = DS . 'my' . DS . 'path' . DS . 'tests' . DS;
|
||||||
|
|
||||||
$result = $this->Task->testCaseFileName('Model', 'Post');
|
$result = $this->Task->testCaseFileName('Model', 'Post');
|
||||||
$expected = $this->Task->path . 'Case' . DS . 'Model' . DS . 'PostTest.php';
|
$expected = $this->Task->path . 'Case' . DS . 'Model' . DS . 'PostTest.php';
|
||||||
|
|
Loading…
Add table
Reference in a new issue