elbunce/oauth2-php — pull request #1 by vbardales (2012-02-17 12:25:54+00:00)
Title: Fix test suite and change requires to require_onces

Hi,

I've tried to launch phpunit All_OAuth2_Tests.php but I got an errror :

Fatal error: Cannot redeclare class OAuth2ServerException in /var/local/webroot/elbunce-oauth2-php-f2f729e/lib/OAuth2ServerException.php on line 82

Call Stack:
0.0003 325764 1. {main}() /mnt/home_distant/vbardales/pear/bin/phpunit:0
0.0113 757672 2. PHPUnit_TextUI_Command::main() /mnt/home_distant/vbardales/pear/bin/phpunit:46
0.0114 758240 3. PHPUnit_TextUI_Command->run() /mnt/home_distant/vbardales/pear/PEAR/PHPUnit/TextUI/Command.php:130
0.3008 1241140 4. PHPUnit_Runner_BaseTestRunner->getTest() /mnt/home_distant/vbardales/pear/PEAR/PHPUnit/TextUI/Command.php:150
0.3169 1575740 5. ReflectionMethod->invoke() /mnt/home_distant/vbardales/pear/PEAR/PHPUnit/Runner/BaseTestRunner.php:124
0.3170 1575772 6. All_OAuth2_Tests::suite() /var/local/webroot/elbunce-oauth2-php-f2f729e/tests/All_OAuth2_Tests.php:0
0.3170 1576816 7. All_OAuth2_Tests->__construct() /var/local/webroot/elbunce-oauth2-php-f2f729e/tests/All_OAuth2_Tests.php:26
0.3636 3164108 8. require('/var/local/webroot/elbunce-oauth2-php-f2f729e/tests/OAuth2Test.php') /var/local/webroot/elbunce-oauth2-php-f2f729e/tests/All_OAuth2_Tests.php:16
0.3660 3389360 9. require('/var/local/webroot/elbunce-oauth2-php-f2f729e/lib/OAuth2.php') /var/local/webroot/elbunce-oauth2-php-f2f729e/tests/OAuth2Test.php:2

So I update requires to require_onces to avoid redeclarations. Each file being included once because all of them are classes, I updated all files to update requires to require_onces.