Hey all
I'm installing phpunit 3.5.6 to take a look at how the unit tests are
used.
I've got it all installed as per
http://docs.joomla.org/Running_Automated_Tests_for_Version_1.6#Running_Unit_Tests
But I think there are issues with the test set up and phpunit 3.5.6
when I run this from the command line:
$sudo /Applications/XAMPP/xamppfiles/bin/phpunit /Applications/XAMPP/
htdocs/fabrik30x/tests/unit/suite/libraries/joomla/utilities/
JArrayHelperTest.php
I get
Notice: Please no longer include "PHPUnit/Framework.php". in /
Applications/XAMPP/xamppfiles/lib/php/pear/PHPUnit/Framework.php on
line 50
Fatal error: Call to undefined method
PHPUnit_Util_Filter::addDirectoryToFilter() in /Applications/XAMPP/
xamppfiles/htdocs/fabrik30x/tests/unit/bootstrap.php on line 59
I can fix the fatal error by editing /test/unit/bootstrap.php and
replacing
PHPUnit_Util_Filter::addDirectoryToFilter(JPATH_BASE . '/tests');
with
PHP_CodeCoverage_Filter::getInstance()-
>addDirectoryToBlacklist(JPATH_BASE . '/tests');
However, I guess that will not work as a general solution for people
using older versions of phpunit? Does anyone know how to test which
version of phpunit is installed from within PHP
Also I'm not sure how to resolve the warning, although that is less
important as the tests will run with the code change I mentioned above