Skip to content
This repository has been archived by the owner on Mar 25, 2024. It is now read-only.

Add interfaces for data structures #13

Merged
merged 11 commits into from
May 30, 2019
Prev Previous commit
Next Next commit
test client data getApplicationParameter
  • Loading branch information
Firehed committed May 30, 2019
commit b4b4c882bd77fc1e571e6fbb78d2f23c0903db4b
20 changes: 20 additions & 0 deletions tests/ClientDataTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,26 @@ public function testGetChallengeParameter()
);
}

/**
* @covers ::getApplicationParameter
*/
public function testGetApplicationParameter()
{
$goodData = [
'typ' => 'navigator.id.finishEnrollment',
'challenge' => 'PfsWR1Umy2V5Al1Bam2tG0yfPLeJElfwRzzAzkYPgzo',
'origin' => 'https://u2f.ericstern.com',
'cid_pubkey' => '',
];
$goodJson = json_encode($goodData);
assert($goodJson !== false);
$clientData = ClientData::fromJson($goodJson);
$this->assertSame(
hash('sha256', 'https://u2f.ericstern.com', true),
$clientData->getApplicationParameter()
);
}

/**
* @covers ::fromJson
*/
Expand Down