Use hex2bin() instead of pack()
[lhc/web/wiklou.git] / tests / phpunit / includes / utils / MWCryptHashTest.php
index 406f421..4c85c3d 100644 (file)
@@ -21,10 +21,12 @@ class MWCryptHashTest extends MediaWikiTestCase {
                }
 
                $data = 'foobar';
+               // @codingStandardsIgnoreStart Generic.Files.LineLength
                $hash = '9923afaec3a86f865bb231a588f453f84e8151a2deb4109aebc6de4284be5bebcff4fab82a7e51d920237340a043736e9d13bab196006dcca0fe65314d68eab9';
+               // @codingStandardsIgnoreEnd
 
                $this->assertEquals(
-                       pack( 'H*', $hash ),
+                       hex2bin( $hash ),
                        MWCryptHash::hash( $data ),
                        'Raw hash'
                );
@@ -42,10 +44,12 @@ class MWCryptHashTest extends MediaWikiTestCase {
 
                $data = 'foobar';
                $key = 'secret';
+               // @codingStandardsIgnoreStart Generic.Files.LineLength
                $hash = 'ddc94177b2020e55ce2049199fd9cc6327f416ff6dc621cc34cb43d9bec61d73372b4790c0e24957f565ecaf2d42821e6303619093e99cbe14a3b9250bda5f81';
+               // @codingStandardsIgnoreEnd
 
                $this->assertEquals(
-                       pack( 'H*', $hash ),
+                       hex2bin( $hash ),
                        MWCryptHash::hmac( $data, $key ),
                        'Raw hmac'
                );