From 9c5174669eecd1b8729e99b0d96750db26bf94f6 Mon Sep 17 00:00:00 2001 From: Max Semenik Date: Wed, 2 Jan 2019 00:21:13 -0800 Subject: [PATCH] Unbreak Pbkdf2PasswordTest Due to https://github.com/sebastianbergmann/phpunit/issues/3459 it was looking for a wrong function name and was skipping the test even when PHP support was present. Change-Id: I2508f192a76275286e95bd6a06e4628d98b11737 --- tests/phpunit/includes/password/Pbkdf2PasswordTest.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/phpunit/includes/password/Pbkdf2PasswordTest.php b/tests/phpunit/includes/password/Pbkdf2PasswordTest.php index 9e8b830ff3..b9b1ef6a2d 100644 --- a/tests/phpunit/includes/password/Pbkdf2PasswordTest.php +++ b/tests/phpunit/includes/password/Pbkdf2PasswordTest.php @@ -5,9 +5,17 @@ * @covers Pbkdf2Password * @covers Password * @covers ParameterizedPassword - * @requires function hash_pbkdf2 */ class Pbkdf2PasswordTest extends PasswordTestCase { + public function setUp() { + parent::setUp(); + // Can't be done with annotations due to + // https://github.com/sebastianbergmann/phpunit/issues/3459 + if ( !function_exists( 'hash_pbkdf2' ) ) { + $this->markTestSkipped( 'function hash_pbkdf2 is required' ); + } + } + protected function getTypeConfigs() { return [ 'pbkdf2' => [ 'class' => Pbkdf2Password::class, -- 2.20.1