dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Add @covers tags for more tests"
[lhc/web/wiklou.git]
/
tests
/
phpunit
/
includes
/
utils
/
MWCryptHashTest.php
diff --git
a/tests/phpunit/includes/utils/MWCryptHashTest.php
b/tests/phpunit/includes/utils/MWCryptHashTest.php
index
ad54e2f
..
66c8d00
100644
(file)
--- a/
tests/phpunit/includes/utils/MWCryptHashTest.php
+++ b/
tests/phpunit/includes/utils/MWCryptHashTest.php
@@
-1,10
+1,13
@@
<?php
<?php
+
/**
/**
- *
* @group Hash
* @group Hash
+ *
+ * @covers MWCryptHash
*/
*/
+class MWCryptHashTest extends PHPUnit_Framework_TestCase {
-class MWCryptHashTest extends MediaWikiTestCase {
+ use MediaWikiCoversValidator;
public function testHashLength() {
if ( MWCryptHash::hashAlgo() !== 'whirlpool' ) {
public function testHashLength() {
if ( MWCryptHash::hashAlgo() !== 'whirlpool' ) {
@@
-21,12
+24,11
@@
class MWCryptHashTest extends MediaWikiTestCase {
}
$data = 'foobar';
}
$data = 'foobar';
- //
@codingStandardsIgnoreStart
Generic.Files.LineLength
+ //
phpcs:ignore
Generic.Files.LineLength
$hash = '9923afaec3a86f865bb231a588f453f84e8151a2deb4109aebc6de4284be5bebcff4fab82a7e51d920237340a043736e9d13bab196006dcca0fe65314d68eab9';
$hash = '9923afaec3a86f865bb231a588f453f84e8151a2deb4109aebc6de4284be5bebcff4fab82a7e51d920237340a043736e9d13bab196006dcca0fe65314d68eab9';
- // @codingStandardsIgnoreEnd
$this->assertEquals(
$this->assertEquals(
-
pack( 'H*',
$hash ),
+
hex2bin(
$hash ),
MWCryptHash::hash( $data ),
'Raw hash'
);
MWCryptHash::hash( $data ),
'Raw hash'
);
@@
-44,12
+46,11
@@
class MWCryptHashTest extends MediaWikiTestCase {
$data = 'foobar';
$key = 'secret';
$data = 'foobar';
$key = 'secret';
- //
@codingStandardsIgnoreStart
Generic.Files.LineLength
+ //
phpcs:ignore
Generic.Files.LineLength
$hash = 'ddc94177b2020e55ce2049199fd9cc6327f416ff6dc621cc34cb43d9bec61d73372b4790c0e24957f565ecaf2d42821e6303619093e99cbe14a3b9250bda5f81';
$hash = 'ddc94177b2020e55ce2049199fd9cc6327f416ff6dc621cc34cb43d9bec61d73372b4790c0e24957f565ecaf2d42821e6303619093e99cbe14a3b9250bda5f81';
- // @codingStandardsIgnoreEnd
$this->assertEquals(
$this->assertEquals(
-
pack( 'H*',
$hash ),
+
hex2bin(
$hash ),
MWCryptHash::hmac( $data, $key ),
'Raw hmac'
);
MWCryptHash::hmac( $data, $key ),
'Raw hmac'
);