Skip to content

Commit 32c7ba2

Browse files
committed
skip sha512 tests when it's not available
This makes the entire testsuite run through on HHVM 3.8.0 on phpunit beta-2015-06-18 :-) Note: this does not mean that DokuWiki is fully compatible with HHVM, but it's a good step!
1 parent 2ad45ad commit 32c7ba2

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

_test/tests/inc/auth_password.test.php

+8-1
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,16 @@ class auth_password_test extends DokuWikiTest {
1616
'kmd5' => 'a579299436d7969791189acadd86fcb716',
1717
'djangomd5' => 'md5$abcde$d0fdddeda8cd92725d2b54148ac09158',
1818
'djangosha1' => 'sha1$abcde$c8e65a7f0acc9158843048a53dcc5a6bc4d17678',
19-
'sha512' => '$6$abcdefgh12345678$J9.zOcgx0lotwZdcz0uulA3IVQMinZvFZVjA5vapRLVAAqtay23XD4xeeUxQ3B4JvDWYFBIxVWW1tOYlHX13k1'
19+
2020
);
2121

22+
function __construct() {
23+
if(defined('CRYPT_SHA512') && CRYPT_SHA512 == 1) {
24+
// Check SHA512 only if available in this PHP
25+
$this->passes['sha512'] = '$6$abcdefgh12345678$J9.zOcgx0lotwZdcz0uulA3IVQMinZvFZVjA5vapRLVAAqtay23XD4xeeUxQ3B4JvDWYFBIxVWW1tOYlHX13k1';
26+
}
27+
}
28+
2229

2330
function test_cryptPassword(){
2431
foreach($this->passes as $method => $hash){

0 commit comments

Comments
 (0)