phpunit 3.5.6 and bootstrap.php

195 views
Skip to first unread message

pollen8

unread,
Dec 28, 2010, 9:47:07 AM12/28/10
to Joomla! Framework Development
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

Mark Dexter

unread,
Jan 2, 2011, 2:34:59 PM1/2/11
to joomla-dev...@googlegroups.com
Hi. Evidently they made some changes in PHPUnit version 3.5 and it doesn't currently work with the Joomla! tests. I would recommend uninstalling version 3.5 and installing version 3.4.15 as indicated in the instructions:

Important Note as of 13 October 2010: PUPUnit version 3.5 was recently released. This version appears to require some changes to the unit tests. For now, we are continuing to use version 3.4.15. To install that version, just add -3.4.15 to the end of the install commands below. For example: pear install phpunit/PHPUnit-3.4.15.

I think we will try to support PHPUnit 3.5 for the unit tests once Joomla! version 1.6 is released.

Good luck. Mark


--
You received this message because you are subscribed to the Google Groups "Joomla! Framework Development" group.
To post to this group, send an email to joomla-dev...@googlegroups.com.
To unsubscribe from this group, send email to joomla-dev-frame...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/joomla-dev-framework?hl=en-GB.


pollen8

unread,
Jan 4, 2011, 5:05:02 AM1/4/11
to Joomla! Framework Development
thanks Mark

Everything seems to work ok with that one fix, so I think I will live
with the warning and continue using 3.5. I'll report back if I do find
anything else

Rob

On Jan 2, 8:34 pm, Mark Dexter <dextercow...@gmail.com> wrote:
> Hi. Evidently they made some changes in PHPUnit version 3.5 and it doesn't
> currently work with the Joomla! tests. I would recommend uninstalling
> version 3.5 and installing version 3.4.15 as indicated in the instructions:
>
> *Important Note as of 13 October 2010: PUPUnit version 3.5 was recently
> released. This version appears to require some changes to the unit tests.
> For now, we are continuing to use version 3.4.15. To install that version,
> just add -3.4.15 to the end of the install commands below. For example:* pear
> install phpunit/PHPUnit-3.4.15.
>
> I think we will try to support PHPUnit 3.5 for the unit tests once Joomla!
> version 1.6 is released.
>
> Good luck. Mark
>
> On Tue, Dec 28, 2010 at 6:47 AM, pollen8 <r...@pollen-8.co.uk> wrote:
> > 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#Runnin...
> > joomla-dev-frame...@googlegroups.com<joomla-dev-framework%2Bunsu...@googlegroups.com>
> > .
Reply all
Reply to author
Forward
0 new messages