From 0d5a0dbf06d8b7c91c27f04dee7b99838ee54388 Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Tue, 7 Oct 2014 05:22:02 +0200 Subject: [PATCH] MWCryptHKDFTest: Mock $wgSecretKey to ensure atomicity Follows-up af66c04. The tests depend indirectly on wgSecretKey (used by MWCryptHKDF::generateHex). On test installs I tend to set this to "example" or "***", which is less than 16 characters and thus the unit tests failed with "MWCryptHKDF secret was too short". Change-Id: I9a85fd9fbb345863e4837fed2910d60ebf1b0d83 --- tests/phpunit/includes/utils/MWCryptHKDFTest.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/phpunit/includes/utils/MWCryptHKDFTest.php b/tests/phpunit/includes/utils/MWCryptHKDFTest.php index 7e37534a77..73e4c1a909 100644 --- a/tests/phpunit/includes/utils/MWCryptHKDFTest.php +++ b/tests/phpunit/includes/utils/MWCryptHKDFTest.php @@ -6,6 +6,12 @@ class MWCryptHKDFTest extends MediaWikiTestCase { + protected function setUp() { + parent::setUp(); + + $this->setMwGlobals( 'wgSecretKey', '5bf1945342e67799cb50704a7fa19ac6' ); + } + /** * Test basic usage works */ -- 2.20.1