Skip to content

Commit

Permalink
Unbreak Pbkdf2PasswordTest
Browse files Browse the repository at this point in the history
Due to sebastianbergmann/phpunit#3459 it was
looking for a wrong function name and was skipping the test even when PHP
support was present.

Change-Id: I2508f192a76275286e95bd6a06e4628d98b11737
  • Loading branch information
MaxSem committed Jan 2, 2019
1 parent 032f640 commit 9c51746
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tests/phpunit/includes/password/Pbkdf2PasswordTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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

This comment has been minimized.

Copy link
@epdenouden

epdenouden Jan 15, 2019

This bug has been fixed in PHPUnit version 7.5.2

This comment has been minimized.

Copy link
@MaxSem

MaxSem Jan 15, 2019

Author Contributor

Thanks for fixing it so awesomely quickly! We can't use it yet though, as we still have to support PHP 7.0 :|

This comment has been minimized.

Copy link
@epdenouden

epdenouden Jan 16, 2019

Having seen the composer.json when I cloned the repo, I was afraid of that. Sorry @MaxSem! That's quite a bummer for you, I understand. I will check if I can backport it to 6.5 without risk and ask Sebastian if he would consider a bugfix minor. It's a security test after all :)

This comment has been minimized.

Copy link
@epdenouden

epdenouden Feb 1, 2019

@MaxSem This fix should have made it's way to PHPUnit 6.5.14: https://github.com/sebastianbergmann/phpunit/blob/6.5/ChangeLog-6.5.md

This comment has been minimized.

Copy link
@legoktm

legoktm Feb 1, 2019

Member

Thanks, just submitted https://gerrit.wikimedia.org/r/c/mediawiki/core/+/487513 to revert this!

if ( !function_exists( 'hash_pbkdf2' ) ) {
$this->markTestSkipped( 'function hash_pbkdf2 is required' );
}
}

protected function getTypeConfigs() {
return [ 'pbkdf2' => [
'class' => Pbkdf2Password::class,
Expand Down

0 comments on commit 9c51746

Please sign in to comment.