Forums / Developer / EZ Unit Tests / Comment51065

Author Topic

Russell Michell

Thursday 30 April 2009 3:10:37 pm

Comment51065

Hi Marouane:

I'm sorry to "Hijack" your thread but I wanted to ask how you got started with unit-testing in ez?

I mean, documentation for it is hard to come by - the info I found at ezpedia.org seems to assume a level of understanding not just of Unit Testing but Unit Testing with PHP - something I personally don't have (yet).

Are you (or anyone reading this) well-versed enough to write a brief Article for ez.no?

"Introduction to Unit Testing with eZ" ? :-)

I have obtained PHPUnit and checked-out the ez 'tests' directory from SVN but I keep getting errors from PHPUnit when running runtests.php.

#> php tests/runtests.php -D mysql:://Exponential-D:ezD@localhost/ez_DEV
InvalidArgumentException:  in /usr/local/php/lib/php/PHPUnit/Framework/TestSuite.php on line 305

Call Stack:
    0.0005     117144   1. {main}() /home/russellm/svn/web/Exponential/trunk/duty/tests/runtests.php:0
    0.3099   10388056   2. ezpTestRunner::main() /home/russellm/svn/web/Exponential/trunk/duty/tests/runtests.php:54
    0.3099   10388056   3. ezpTestRunner->runFromArguments() /home/russellm/svn/web/Exponential/trunk/duty/tests/toolkit/ezptestrunner.php:23
    0.3212   11011880   4. ezpTestRunner->prepareTests() /home/russellm/svn/web/Exponential/trunk/duty/tests/toolkit/ezptestrunner.php:34
    0.3213   11011920   5. ezpTestRunner::suite() /home/russellm/svn/web/Exponential/trunk/duty/tests/toolkit/ezptestrunner.php:251
    0.3213   11012040   6. eZTestSuite->__construct() /home/russellm/svn/web/Exponential/trunk/duty/tests/toolkit/ezptestrunner.php:292
    0.3213   11012232   7. PHPUnit_Framework_TestSuite->addTestSuite() /home/russellm/svn/web/Exponential/trunk/duty/tests/suite.php:17

Might this be down to me using an older version of ez? (I have 4.0.1rc2, PHP5.2.9, MySQL 5.0.22 on Linux FC9)

I would find a simple, step-by-step guide very helpful, as I would think others would too.

Thanks for reading,
Russ

Russell Michell, Wellington, New Zealand.
We're building! http://www.theruss.com/blog/
I'm on Twitter: http://twitter.com/therussdotcom

Believe nothing, consider everything.