UnionOfRAD/lithium — Issue #291: fix wrong library path compare (windows li3 test...)
Author: jmglsn
Created: 2012-01-24 16:22:44+00:00
State: open

I'm using li3.bat to run my tests. If I run this tests under windows cmd with a relative path, li3 exists with error message "No library registered for path 'XYZ:\somedir\appdir\tests'".

This happens because the passed path (to test files) contains backslashes, got from request->env('working') (even if test-dir is passed realtive with slashes instead of backslashes).

Now in lithium\console\command\Test in method _library paths with slashes are matched against paths with backslashes, which ends up with "no match".

Possible fix notice: lithium\console\Request in init() - getcwd() will contain backslashes on windows... or in lithium\console\command\Test - _path() in if ($path[0] != '/') {

lithium\console\command\Test - _path()

```php
if ($path[0] != '/') {
$path = $this->request->env('working') . '/' . $path;
$path = str_replace('\\', '/', $path); // windows...
}
```

lithium\console\Request in init() - getcwd()

```php
$this->_env['working'] = str_replace('\\', '/', getcwd()) ?: null; // windows
```

Thank you :)