I created my own rule rule codes. They work fine. Now I want to test the codes using PHP UnitTest. PhpCodesniffer already has its own framework for the PHPUnit test case.
Thus, using this, I extended the AbstractSniffUnitTest class and unit test at the location Standards/TestRules/Tests/Function/FunctionUnitTest.php and the script, which should be tested in Standards/TestRules/Tests/Function/FunctionUnitTest.inc .
But when I am going to run the script with the phpunit PEAR\PHP\tests\AllTests.php , it gives the following error.
PHPUnit 3.5.14 by Sebastian Bergmann. ......................................F Time: 6 seconds, Memory: 10.00Mb There was 1 failure: 1) TestRules_Tests_Function_FunctionUnitTest::getErrorList An unexpected exception has been caught: Source file C:/Program Files/PHP/PEAR/PHP/CodeSniffer/Standards/TestRules/Tests/Function/FunctionUnitTest.inc does not exist C:\Program Files\PHP\PEAR\PHP\tests\Standards\AbstractSniffUnitTest.php:138 C:\Program Files\PHP\PEAR\PHP\tests\TestSuite.php:48 FAILURES! Tests: 39, Assertions: 146, Failures: 1. Warning: Deprecated PHPUnit features are being used 2 times! Use --verbose for more information.
It gives an error file FunctionUnitTest.inc not found in the specified location. I gave full permission to the folder, also checking the path and location of the file, but it gives the same error. I also tested it on a linux machine, but it gives the same error.
Is this a problem of my code or a problem with unittest framework code?
source share