From 32c7ba22db35fd22aed87fb31984069873cefc4f Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Fri, 24 Jul 2015 15:18:42 +0200 Subject: 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! --- _test/tests/inc/auth_password.test.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to '_test') diff --git a/_test/tests/inc/auth_password.test.php b/_test/tests/inc/auth_password.test.php index 07b9f5bb2..5067e2ca1 100644 --- a/_test/tests/inc/auth_password.test.php +++ b/_test/tests/inc/auth_password.test.php @@ -16,9 +16,16 @@ class auth_password_test extends DokuWikiTest { 'kmd5' => 'a579299436d7969791189acadd86fcb716', 'djangomd5' => 'md5$abcde$d0fdddeda8cd92725d2b54148ac09158', 'djangosha1' => 'sha1$abcde$c8e65a7f0acc9158843048a53dcc5a6bc4d17678', - 'sha512' => '$6$abcdefgh12345678$J9.zOcgx0lotwZdcz0uulA3IVQMinZvFZVjA5vapRLVAAqtay23XD4xeeUxQ3B4JvDWYFBIxVWW1tOYlHX13k1' + ); + function __construct() { + if(defined('CRYPT_SHA512') && CRYPT_SHA512 == 1) { + // Check SHA512 only if available in this PHP + $this->passes['sha512'] = '$6$abcdefgh12345678$J9.zOcgx0lotwZdcz0uulA3IVQMinZvFZVjA5vapRLVAAqtay23XD4xeeUxQ3B4JvDWYFBIxVWW1tOYlHX13k1'; + } + } + function test_cryptPassword(){ foreach($this->passes as $method => $hash){ -- cgit v1.2.3