MWCryptHKDFTest: Mock $wgSecretKey to ensure atomicity
authorTimo Tijhof <krinklemail@gmail.com>
Tue, 7 Oct 2014 03:22:02 +0000 (05:22 +0200)
committerTimo Tijhof <krinklemail@gmail.com>
Tue, 7 Oct 2014 03:22:37 +0000 (05:22 +0200)
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

index 7e37534..73e4c1a 100644 (file)
@@ -6,6 +6,12 @@
 
 class MWCryptHKDFTest extends MediaWikiTestCase {
 
+       protected function setUp() {
+               parent::setUp();
+
+               $this->setMwGlobals( 'wgSecretKey', '5bf1945342e67799cb50704a7fa19ac6' );
+       }
+
        /**
         * Test basic usage works
         */