FAQ
Edit report at http://pear.php.net/bugs/bug.php?id=18651&edit=1

ID: 18651
Updated by: gaurav.deshmukh123@gmail.com
Reported By: gaurav dot deshmukh123 at gmail dot com
Summary: PHPunit Test cases for custom standards are not
working on Windows.
Status: Open
Type: Bug
Package: PHP_CodeSniffer
Operating System: Windows/Linux
Package Version: 1.3.0
PHP Version: 5.3.6
Roadmap Versions:
New Comment:

Description:
------------
I have created Unit testcases for my custom standard rules.I have
followed the all the instruction given in codesniffer test class
library.Also I have taken refernce from folowing sites.

http://no-mercy.h1236134.stratoserver.net/trac/libIwParsers/browser/trunk/3rdParty/PHP_CodeSniffer-1.2.0/CodeSniffer/Standards/PEAR/Tests/


&

http://blueparabola.com/blog/coding-standard-analysis-using-phpcodesniffer

When I executed test cases on windows envoirment, it return blank result
set as follows.

C:\Program Files\PHP>phpunit PEAR\PHP\tests\AllTests.php

PHPUnit 3.5.14 by Sebastian Bergmann.

........................................

Time: 3 seconds, Memory: 12.25Mb

OK (40 tests, 146 assertions)

Warning: Deprecated PHPUnit features are being used 2 times!
Use --verbose for more information.

But when I executed same test cases on linux enviorment ,it returns
expected result set.

When I checked the AbstractSniffUnitTest file, I found that there is
mapping from Test file to Sniff file.
When file being mapped, the file path contains the mixing of forward &
backward slashes on windows.
because of that it fails at following condition

foreach ($di as $file) {
$path = $file->getPathname();
if (substr($path, 0, strlen($testFileBase)) ===
$testFileBase) {
if ($path !== $testFileBase.'php') {
$testFiles[] = $path;
}
}
}


Is there any way to resolve this issue on windows?


Previous Comments:
------------------------------------------------------------------------

[2011-07-05 13:58:48] ggaurav123

Description:
------------
I have created Unit testcases for my custom standard rules.I have
followed the all the instruction given in codesniffer test class
library.Also I have taken refernce from folowing sites.

http://no-mercy.h1236134.stratoserver.net/trac/libIwParsers/browser/trunk/3rdParty/PHP_CodeSniffer-1.2.0/CodeSniffer/Standards/PEAR/Tests/


&

http://blueparabola.com/blog/coding-standard-analysis-using-phpcodesniffer

When I executed test cases on windows envoirment, it return balnk result
set as follows.

C:\Program Files\PHP>phpunit PEAR\PHP\tests\AllTests.php

PHPUnit 3.5.14 by Sebastian Bergmann.

........................................

Time: 3 seconds, Memory: 12.25Mb

OK (40 tests, 146 assertions)

Warning: Deprecated PHPUnit features are being used 2 times!
Use --verbose for more information.

But when I executed same test cases on linux enviorment ,it returns
expected result set.

When I checked the AbstractSniffUnitTest file, I found that there is
mapping from Test file to Sniff file.
When file being mapped, the file path contains the mixing of forward &
backward slashes on windows.
because of that it fails at following condition

foreach ($di as $file) {
$path = $file->getPathname();
if (substr($path, 0, strlen($testFileBase)) ===
$testFileBase) {
if ($path !== $testFileBase.'php') {
$testFiles[] = $path;
}
}
}


Is there any way to resolve this issue on windows?

------------------------------------------------------------------------

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedJul 5, '11 at 12:00p
activeJul 5, '11 at 12:00p
posts1
users1
websitepear.php.net

1 user in discussion

Gaurav Deshmukh123: 1 post

People

Translate

site design / logo © 2022 Grokbase