Skip to content

Commit 97252e0

Browse files
committed
deprecations
1 parent 7d25c56 commit 97252e0

File tree

4 files changed

+12
-23
lines changed

4 files changed

+12
-23
lines changed

.github/workflows/tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- run: php -m
2727
- run: composer -V
2828
- run: composer install --no-progress
29-
- run: php vendor/bin/phpunit
29+
- run: php vendor/bin/phpunit --no-coverage
3030

3131
windows:
3232
name: Test on Windows
@@ -50,7 +50,7 @@ jobs:
5050
- run: php -m
5151
- run: composer -V
5252
- run: composer install --no-progress
53-
- run: php vendor/bin/phpunit
53+
- run: php vendor/bin/phpunit --no-coverage
5454

5555
code_coverage:
5656
name: Code Coverage

test/unit/HexPrivateKeySerializerTest.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use kornrunner\Serializer\HexPrivateKeySerializer;
66
use Mdanter\Ecc\Curves\CurveFactory;
77
use Mdanter\Ecc\Curves\SecgCurve;
8+
use PHPUnit\Framework\Attributes\DataProvider;
89

910
class HexPrivateKeySerializerTest extends TestCase
1011
{
@@ -18,9 +19,7 @@ public function setUp(): void
1819
$this->serializer = new HexPrivateKeySerializer($generator);
1920
}
2021

21-
/**
22-
* @dataProvider parse
23-
*/
22+
#[DataProvider('parse')]
2423
public function testParse(string $privateKey) {
2524
$key = $this->serializer->parse($privateKey);
2625
$this->assertEquals(gmp_init($privateKey, 16), $key->getSecret());
@@ -33,9 +32,7 @@ public static function parse(): array {
3332
];
3433
}
3534

36-
/**
37-
* @dataProvider serialize
38-
*/
35+
#[DataProvider('serialize')]
3936
public function testSerialize(string $privateKey, string $expect) {
4037
$key = $this->serializer->serialize($this->serializer->parse($privateKey));
4138
$this->assertEquals($expect, $key);

test/unit/HexSignatureSerializerTest.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,12 @@
33
namespace kornrunner;
44

55
use InvalidArgumentException;
6+
use PHPUnit\Framework\Attributes\DataProvider;
67

78
class HexSignatureSerializerTest extends TestCase
89
{
910

10-
/**
11-
* @dataProvider data
12-
*/
11+
#[DataProvider('data')]
1312
public function testParse(string $input, string $expect) {
1413
$sig = $this->sigSerializer->parse($input);
1514
$this->assertEquals($expect, gmp_strval($sig->getR(), 16) . gmp_strval($sig->getS(), 16));
@@ -20,9 +19,7 @@ public function testParseException() {
2019
$this->sigSerializer->parse($this->signed . random_bytes(3));
2120
}
2221

23-
/**
24-
* @dataProvider data
25-
*/
22+
#[DataProvider('data')]
2623
public function testSerialize(string $input, string $expect) {
2724
$parsed = $this->sigSerializer->parse($input);
2825
$signed = $this->sigSerializer->serialize($parsed);

test/unit/Secp256k1Test.php

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace kornrunner;
44

55
use kornrunner\Secp256k1;
6+
use PHPUnit\Framework\Attributes\DataProvider;
67

78
class Secp256k1Test extends TestCase
89
{
@@ -13,9 +14,7 @@ public function setUp(): void {
1314
$this->secp256k1 = new Secp256k1();
1415
}
1516

16-
/**
17-
* @dataProvider sign
18-
*/
17+
#[DataProvider('sign')]
1918
public function testSign(string $message, string $key, array $expected) {
2019
$signature = $this->secp256k1->sign($message, $key);
2120

@@ -53,9 +52,7 @@ public static function sign(): array {
5352
];
5453
}
5554

56-
/**
57-
* @dataProvider verify
58-
*/
55+
#[DataProvider('verify')]
5956
public function testVerify(string $message, string $key, string $publicKey) {
6057
$signature = $this->secp256k1->sign($message, $key);
6158
$this->assertTrue($this->secp256k1->verify($message, $signature, $publicKey));
@@ -68,9 +65,7 @@ public static function verify (): array {
6865
];
6966
}
7067

71-
/**
72-
* @dataProvider verifyWithStringSignature
73-
*/
68+
#[DataProvider('verifyWithStringSignature')]
7469
public function testVerifyWithStringSignature(string $message, string $signatureString, string $publicKey) {
7570
$this->assertTrue($this->secp256k1->verify($message, $signatureString, $publicKey));
7671
}

0 commit comments

Comments
 (0)