Skip to content

Commit 69c1b0d

Browse files
committedAug 5, 2018
Coding Standard updated
1 parent 99e35ae commit 69c1b0d

File tree

3 files changed

+13
-19
lines changed

3 files changed

+13
-19
lines changed
 

‎HS1.php

-6
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,11 @@
1515

1616
final class HS1 extends HMAC
1717
{
18-
/**
19-
* @return string
20-
*/
2118
protected function getHashAlgorithm(): string
2219
{
2320
return 'sha1';
2421
}
2522

26-
/**
27-
* @return string
28-
*/
2923
public function name(): string
3024
{
3125
return 'HS1';

‎RS1.php

-6
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,11 @@ protected function getAlgorithm(): string
2626
return 'sha1';
2727
}
2828

29-
/**
30-
* @return int
31-
*/
3229
protected function getSignatureMethod(): int
3330
{
3431
return JoseRSA::SIGNATURE_PKCS1;
3532
}
3633

37-
/**
38-
* @return string
39-
*/
4034
public function name(): string
4135
{
4236
return 'RS1';

‎Tests/HMACSignatureTest.php

+13-7
Original file line numberDiff line numberDiff line change
@@ -24,31 +24,37 @@
2424
*/
2525
class HMACSignatureTest extends TestCase
2626
{
27-
public function testHS1SignAndVerify()
27+
/**
28+
* @test
29+
*/
30+
public function hS1SignAndVerify()
2831
{
2932
$key = $this->getKey();
3033
$hmac = new HS1();
3134
$data = 'Live long and Prosper.';
3235

33-
self::assertEquals('HS1', $hmac->name());
36+
static::assertEquals('HS1', $hmac->name());
3437

3538
$signature = $hmac->sign($key, $data);
3639

37-
self::assertTrue($hmac->verify($key, $data, $signature));
40+
static::assertTrue($hmac->verify($key, $data, $signature));
3841
}
3942

40-
public function testHS256SignAndVerify()
43+
/**
44+
* @test
45+
*/
46+
public function hS256SignAndVerify()
4147
{
4248
$key = $this->getKey();
4349
$hmac = new HS256_64();
4450
$data = 'Live long and Prosper.';
4551

46-
self::assertEquals('HS256/64', $hmac->name());
52+
static::assertEquals('HS256/64', $hmac->name());
4753

4854
$signature = $hmac->sign($key, $data);
4955

50-
self::assertEquals(\hex2bin('89f750759cb8ad93'), $signature);
51-
self::assertTrue($hmac->verify($key, $data, $signature));
56+
static::assertEquals(\hex2bin('89f750759cb8ad93'), $signature);
57+
static::assertTrue($hmac->verify($key, $data, $signature));
5258
}
5359

5460
private function getKey(): JWK

0 commit comments

Comments
 (0)
Please sign in to comment.