Skip to content

Commit 4ccb647

Browse files
committed
Increase test-coverage
1 parent 5ffcd9f commit 4ccb647

File tree

2 files changed

+36
-1
lines changed

2 files changed

+36
-1
lines changed

tests/Key/AbstractKeyTest.php

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Strobotti\JWK\Key\Tests;
6+
7+
use PHPUnit\Framework\TestCase;
8+
use Strobotti\JWK\Key\AbstractKey;
9+
10+
/**
11+
* @internal
12+
*/
13+
final class AbstractKeyTest extends TestCase
14+
{
15+
public function testCreateFromJSON(): void
16+
{
17+
$json = <<<'EOT'
18+
{
19+
"kty": "RSA",
20+
"use": "sig",
21+
"alg": "RS256",
22+
"kid": "86D88Kf"
23+
}
24+
EOT;
25+
26+
$key = AbstractKeyTest__AbstractKey__Mock::createFromJSON($json);
27+
28+
static::assertSame($json, "{$key}");
29+
}
30+
}
31+
32+
final class AbstractKeyTest__AbstractKey__Mock extends AbstractKey
33+
{
34+
}

tests/Key/RsaTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ public function provideCreateFromJSON(): \Generator
4545
"use": "sig",
4646
"alg": "RS256",
4747
"n": "iGaLqP6y-SJCCBq5Hv6pGDbG_SQ11MNjH7rWHcCFYz4hGwHC4lcSurTlV8u3avoVNM8jXevG1Iu1SY11qInqUvjJur--hghr1b56OPJu6H1iKulSxGjEIyDP6c5BdE1uwprYyr4IO9th8fOwCPygjLFrh44XEGbDIFeImwvBAGOhmMB2AD1n1KviyNsH0bEB7phQtiLk-ILjv1bORSRl8AK677-1T8isGfHKXGZ_ZGtStDe7Lu0Ihp8zoUt59kx2o9uWpROkzF56ypresiIl4WprClRCjz8x6cPZXU2qNWhu71TQvUFwvIvbkE1oYaJMb0jcOTmBRZA2QuYw-zHLwQ",
48-
"e": "AQAB"
48+
"e": "AQAB",
49+
"unsupported": "ignored"
4950
}
5051
EOT
5152
];

0 commit comments

Comments
 (0)