Unbreak Pbkdf2PasswordTest
authorMax Semenik <maxsem.wiki@gmail.com>
Wed, 2 Jan 2019 08:21:13 +0000 (00:21 -0800)
committerMax Semenik <maxsem.wiki@gmail.com>
Wed, 2 Jan 2019 08:21:13 +0000 (00:21 -0800)
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

index 9e8b830..b9b1ef6 100644 (file)
@@ -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,