ZF-2421: Zend_InfoCard tests give 2 warnings before 1 fatal error

Description

The unit test suite for Zend_InfoCard fails with a fatal error:

phpunit --verbose --report Zend_InfoCard_AllTests Zend_InfoCard_AllTests > Zend_InfoCard_AllTests.out 2>&1

I get the following output:

PHPUnit 3.2.8 by Sebastian Bergmann.

Zend Framework - Zend_InfoCard
 Zend_InfoCard_AssertionTest
 ..

 Zend_InfoCard_ProcessTest
 .
Warning: base64_decode() expects exactly 1 parameter, 2 given in c:\Documents and Settings\dfelton\My Documents\SVN Remo
te\Zend Framework\trunk\library\Zend\InfoCard\Xml\SecurityTokenReference.php on line 154

Call Stack:
    0.0405   1. {main}() c:\wamp\php\PEAR\PHPUnit\TextUI\Command.php:0
    7.1995   2. PHPUnit_TextUI_Command::main() c:\wamp\php\PEAR\PHPUnit\TextUI\Command.php:528
    8.5641   3. PHPUnit_TextUI_TestRunner->doRun() c:\wamp\php\PEAR\PHPUnit\TextUI\Command.php:112
    8.5660   4. PHPUnit_Framework_TestSuite->run() C:\wamp\php\PEAR\PHPUnit\TextUI\TestRunner.php:298
    9.5484   5. PHPUnit_Framework_TestSuite->run() C:\wamp\php\PEAR\PHPUnit\Framework\TestSuite.php:633
    9.6111   6. PHPUnit_Framework_TestSuite->runTest() C:\wamp\php\PEAR\PHPUnit\Framework\TestSuite.php:650
    9.6111   7. PHPUnit_Framework_TestCase->run() C:\wamp\php\PEAR\PHPUnit\Framework\TestSuite.php:670
    9.6111   8. PHPUnit_Framework_TestResult->run() C:\wamp\php\PEAR\PHPUnit\Framework\TestCase.php:351
    9.6116   9. PHPUnit_Framework_TestCase->runBare() C:\wamp\php\PEAR\PHPUnit\Framework\TestResult.php:597
    9.6212  10. PHPUnit_Framework_TestCase->runTest() C:\wamp\php\PEAR\PHPUnit\Framework\TestCase.php:376
    9.6215  11. ReflectionMethod->invoke() C:\wamp\php\PEAR\PHPUnit\Framework\TestCase.php:449
    9.6215  12. Zend_InfoCard_ProcessTest->testStandAloneProcess() c:\Documents and Settings\dfelton\My Documents\SVN Re
mote\Zend Framework\trunk\tests\Zend\InfoCard\ProcessTest.php:0
    9.6340  13. Zend_InfoCard->process() c:\Documents and Settings\dfelton\My Documents\SVN Remote\Zend Framework\trunk\
tests\Zend\InfoCard\ProcessTest.php:130
    9.6343  14. Zend_InfoCard->_extractSignedToken() c:\Documents and Settings\dfelton\My Documents\SVN Remote\Zend Fram
ework\trunk\library\Zend\InfoCard.php:409
    9.7970  15. Zend_InfoCard_Xml_SecurityTokenReference->getKeyReference() c:\Documents and Settings\dfelton\My Documen
ts\SVN Remote\Zend Framework\trunk\library\Zend\InfoCard.php:371
    9.7983  16. base64_decode() c:\Documents and Settings\dfelton\My Documents\SVN Remote\Zend Framework\trunk\library\Z
end\InfoCard\Xml\SecurityTokenReference.php:154

.
Warning: base64_decode() expects exactly 1 parameter, 2 given in c:\Documents and Settings\dfelton\My Documents\SVN Remo
te\Zend Framework\trunk\library\Zend\InfoCard\Xml\SecurityTokenReference.php on line 154

Call Stack:
    0.0405   1. {main}() c:\wamp\php\PEAR\PHPUnit\TextUI\Command.php:0
    7.1995   2. PHPUnit_TextUI_Command::main() c:\wamp\php\PEAR\PHPUnit\TextUI\Command.php:528
    8.5641   3. PHPUnit_TextUI_TestRunner->doRun() c:\wamp\php\PEAR\PHPUnit\TextUI\Command.php:112
    8.5660   4. PHPUnit_Framework_TestSuite->run() C:\wamp\php\PEAR\PHPUnit\TextUI\TestRunner.php:298
    9.5484   5. PHPUnit_Framework_TestSuite->run() C:\wamp\php\PEAR\PHPUnit\Framework\TestSuite.php:633
    9.8108   6. PHPUnit_Framework_TestSuite->runTest() C:\wamp\php\PEAR\PHPUnit\Framework\TestSuite.php:650
    9.8109   7. PHPUnit_Framework_TestCase->run() C:\wamp\php\PEAR\PHPUnit\Framework\TestSuite.php:670
    9.8109   8. PHPUnit_Framework_TestResult->run() C:\wamp\php\PEAR\PHPUnit\Framework\TestCase.php:351
    9.8114   9. PHPUnit_Framework_TestCase->runBare() C:\wamp\php\PEAR\PHPUnit\Framework\TestResult.php:597
    9.8198  10. PHPUnit_Framework_TestCase->runTest() C:\wamp\php\PEAR\PHPUnit\Framework\TestCase.php:376
    9.8201  11. ReflectionMethod->invoke() C:\wamp\php\PEAR\PHPUnit\Framework\TestCase.php:449
    9.8201  12. Zend_InfoCard_ProcessTest->testPlugins() c:\Documents and Settings\dfelton\My Documents\SVN Remote\Zend
Framework\trunk\tests\Zend\InfoCard\ProcessTest.php:0
    9.8336  13. Zend_InfoCard->process() c:\Documents and Settings\dfelton\My Documents\SVN Remote\Zend Framework\trunk\
tests\Zend\InfoCard\ProcessTest.php:149
    9.8339  14. Zend_InfoCard->_extractSignedToken() c:\Documents and Settings\dfelton\My Documents\SVN Remote\Zend Fram
ework\trunk\library\Zend\InfoCard.php:409
    9.8530  15. Zend_InfoCard_Xml_SecurityTokenReference->getKeyReference() c:\Documents and Settings\dfelton\My Documen
ts\SVN Remote\Zend Framework\trunk\library\Zend\InfoCard.php:371
    9.8547  16. base64_decode() c:\Documents and Settings\dfelton\My Documents\SVN Remote\Zend Framework\trunk\library\Z
end\InfoCard\Xml\SecurityTokenReference.php:154


Fatal error: Class 'Zend_InfoCard_Cipher_Symmetric_Adapter_AES256CBC' not found in c:\Documents and Settings\dfelton\My
Documents\SVN Remote\Zend Framework\trunk\tests\Zend\InfoCard\ProcessTest.php on line 157

Call Stack:
    0.0405   1. {main}() c:\wamp\php\PEAR\PHPUnit\TextUI\Command.php:0
    7.1995   2. PHPUnit_TextUI_Command::main() c:\wamp\php\PEAR\PHPUnit\TextUI\Command.php:528
    8.5641   3. PHPUnit_TextUI_TestRunner->doRun() c:\wamp\php\PEAR\PHPUnit\TextUI\Command.php:112
    8.5660   4. PHPUnit_Framework_TestSuite->run() C:\wamp\php\PEAR\PHPUnit\TextUI\TestRunner.php:298
    9.5484   5. PHPUnit_Framework_TestSuite->run() C:\wamp\php\PEAR\PHPUnit\Framework\TestSuite.php:633
    9.8108   6. PHPUnit_Framework_TestSuite->runTest() C:\wamp\php\PEAR\PHPUnit\Framework\TestSuite.php:650
    9.8109   7. PHPUnit_Framework_TestCase->run() C:\wamp\php\PEAR\PHPUnit\Framework\TestSuite.php:670
    9.8109   8. PHPUnit_Framework_TestResult->run() C:\wamp\php\PEAR\PHPUnit\Framework\TestCase.php:351
    9.8114   9. PHPUnit_Framework_TestCase->runBare() C:\wamp\php\PEAR\PHPUnit\Framework\TestResult.php:597
    9.8198  10. PHPUnit_Framework_TestCase->runTest() C:\wamp\php\PEAR\PHPUnit\Framework\TestCase.php:376
    9.8201  11. ReflectionMethod->invoke() C:\wamp\php\PEAR\PHPUnit\Framework\TestCase.php:449
    9.8201  12. Zend_InfoCard_ProcessTest->testPlugins() c:\Documents and Settings\dfelton\My Documents\SVN Remote\Zend
Framework\trunk\tests\Zend\InfoCard\ProcessTest.php:0

Running WinXP, PHP 5.1.4; I can provide more information about my environment upon request.

Comments

The second parameter of base64_decode isn't available unless you have PHP 5.2.0+ so I added a version check to make sure before moving forward..

http://www.php.net/base64_decode

I would just remove the strict-check, but considering the security/identity nature of the component I think being as strict as possible makes sense here..

Reopening issue with new but strongly correlated test results:

There were 3 errors:

1) testStandAloneProcess(Zend_InfoCard_ProcessTest)
base64_decode() expects exactly 1 parameter, 2 given
c:\Documents and Settings\dfelton\My Documents\SVN Remote\Zend Framework\trunk\library\Zend\InfoCard.php:387
c:\Documents and Settings\dfelton\My Documents\SVN Remote\Zend Framework\trunk\library\Zend\InfoCard.php:409
c:\Documents and Settings\dfelton\My Documents\SVN Remote\Zend Framework\trunk\tests\Zend\InfoCard\ProcessTest.php:130

2) testPlugins(Zend_InfoCard_ProcessTest)
base64_decode() expects exactly 1 parameter, 2 given
c:\Documents and Settings\dfelton\My Documents\SVN Remote\Zend Framework\trunk\library\Zend\InfoCard.php:387
c:\Documents and Settings\dfelton\My Documents\SVN Remote\Zend Framework\trunk\library\Zend\InfoCard.php:409
c:\Documents and Settings\dfelton\My Documents\SVN Remote\Zend Framework\trunk\tests\Zend\InfoCard\ProcessTest.php:149

3) testClaims(Zend_InfoCard_ProcessTest)
base64_decode() expects exactly 1 parameter, 2 given
c:\Documents and Settings\dfelton\My Documents\SVN Remote\Zend Framework\trunk\library\Zend\InfoCard.php:387
c:\Documents and Settings\dfelton\My Documents\SVN Remote\Zend Framework\trunk\library\Zend\InfoCard.php:409
c:\Documents and Settings\dfelton\My Documents\SVN Remote\Zend Framework\trunk\tests\Zend\InfoCard\ProcessTest.php:170

Fixed with SVN r8600.

Fixed for 1.5.0RC2 with SVN r8601.