From: Timo Tijhof Date: Tue, 7 Oct 2014 03:22:02 +0000 (+0200) Subject: MWCryptHKDFTest: Mock $wgSecretKey to ensure atomicity X-Git-Tag: 1.31.0-rc.0~13670^2 X-Git-Url: http://git.cyclocoop.org/url?a=commitdiff_plain;h=0d5a0dbf06d8b7c91c27f04dee7b99838ee54388;p=lhc%2Fweb%2Fwiklou.git 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 --- 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 */