Skip to content

Commit

Permalink
Add more data for test
Browse files Browse the repository at this point in the history
  • Loading branch information
donhardman committed May 20, 2021
1 parent 89c88c7 commit 19048f7
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions test/ES256Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,25 @@
class ES256Test extends TestCase {
protected ES256 $jwt;
protected function setUp(): void {
$public = '03fce314340b325d4949f4dd385ac81adcdc3f89a087b99abae96088606d201274';
$private = 'ba6bd7087653b7883a99cd3c8d385e30a188aa3204120e838072762f667e07de';
$public = '031587e192182b8a826d720bb81b944e2b979f7f27a149abd9b38bf00fb52cc218';
$private = 'c98a3420971233ee39bcca3d120f8ead3d90695dfedb26d8609bb7c0b451b14d';
$this->jwt = ES256::create(
$public,
$private
);
}

public function testEncodeDecode() {
$data = ['hello', 'world'];
$data = array(
"data" => [
"name" => "ZiHang Gao",
"admin" => true
],
"iss" => "http://example.org",
"sub" => "1234567890",
);
$token = $this->jwt->encode($data);
var_dump($token);exit;
$this->assertIsString($token);
$decoded = $this->jwt->decode($token);
$this->assertIsArray($decoded);
Expand Down

0 comments on commit 19048f7

Please sign in to comment.