summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorhttp://j3h.us/ <http://j3h.us/@aja.local>2008-06-20 22:56:09 +0000
committerhttp://j3h.us/ <http://j3h.us/@aja.local>2008-06-20 22:56:09 +0000
commit36bde7cde14298822a6c904d1dde3ff9ccab506c (patch)
tree171fe487b85fe790d33e54d6fb050998483251ce /Tests
parent81c49fa2a5ea13814c92bce10c5a94bcde84e59b (diff)
downloadphp-openid-36bde7cde14298822a6c904d1dde3ff9ccab506c.zip
php-openid-36bde7cde14298822a6c904d1dde3ff9ccab506c.tar.gz
php-openid-36bde7cde14298822a6c904d1dde3ff9ccab506c.tar.bz2
[project @ Do not attempt HMAC-SHA256 tests if HMAC-SHA256 is not supported]
Diffstat (limited to 'Tests')
-rw-r--r--Tests/Auth/OpenID/HMAC.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/Tests/Auth/OpenID/HMAC.php b/Tests/Auth/OpenID/HMAC.php
index cc2655a..874892a 100644
--- a/Tests/Auth/OpenID/HMAC.php
+++ b/Tests/Auth/OpenID/HMAC.php
@@ -135,9 +135,13 @@ class Tests_Auth_OpenID_HMAC extends PHPUnit_TestSuite {
function Tests_Auth_OpenID_HMAC($name)
{
$this->setName($name);
- foreach (array(array('Auth_OpenID_HMACSHA1', 'hmac-sha1.txt', 20),
- array('Auth_OpenID_HMACSHA256', 'hmac-sha256.txt', 32))
- as $params) {
+ $hash_test_defs = array(array(
+ 'Auth_OpenID_HMACSHA1', 'hmac-sha1.txt', 20));
+ if (Auth_OpenID_HMACSHA256_SUPPORTED) {
+ $hash_test_defs[] =
+ array('Auth_OpenID_HMACSHA256', 'hmac-sha256.txt', 32);
+ }
+ foreach ($hash_test_defs as $params) {
list($hash_func, $filename, $hash_len) = $params;
$cases = $this->_readTestCases($filename, $hash_len);
foreach ($cases as $case) {