views:

29

answers:

1

I'm trying to run the test scripts that come with JanRain's php openid libraries. I've installed PHPUnit using pear. When I try to run the scripts I get:

Fatal error: Class 'PHPUnit_Framework_TestCase' not found in /var/www/localhost/htdocs/openid/openid/Tests/Auth/OpenID/StoreTest.php on line 72

I'm sure this is a really simple issue. I just can't figure out what's wrong.

I don't see anywhere that the PHPUnit files get included, so do I need to make them automatically included somewhere?

server info: http://info.theunlink.com/info.php I'm using the latest git sources: http://github.com/openid/php-openid

(I'm trying to run the test stuff because I get "OpenID authentication failed: Nonce already used or out of range" every other time I try to login and I'm trying to find where the issue is.)

+1  A: 

What PHPUnit version do you have? There is a really ancient one in PEAR, you need a recent one - 3.4

With that out of the way, how exactly are you running the tests? I did a git clone and then executed command:

php admin/texttest.php

This did run at least part of the test suite.

Anti Veeranna
I was trying to run the individual test files in /Tests/Auth/OpenID/ within a browser.
BigPat
That wont work. Initialization/bootstrap code is needed, as you assumed yourself, and that code is elsewhere, admin/texttest.php is one of these places.
Anti Veeranna
That makes sense. I was only doing it that way because in my Googling I came across someone being told to do that and it never crossed my mind that someone on the internet was wrong.It started running through once and hit the memory limit, 128M! I've upped it to 512 for the moment, if it hits that I'm going to assume something is wrong. Thanks for all your help.
BigPat