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

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
lookyman committed Jul 7, 2016
1 parent b73446d commit 1bb9cb5
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 32 deletions.
1 change: 0 additions & 1 deletion .coveralls.yml
@@ -1,4 +1,3 @@
service_name: travis-ci
src_dir: src
coverage_clover: coverage.xml
json_path: coverage.json
1 change: 0 additions & 1 deletion .gitignore
@@ -1,3 +1,2 @@
tests/tmp/*
vendor/*
composer.lock
1 change: 1 addition & 0 deletions composer.json
Expand Up @@ -12,6 +12,7 @@
],
"require": {
"php": ">=7.0",
"ext-openssl": "*",
"nette/finder": "^2.4",
"nette/utils": "^2.4"
},
Expand Down
2 changes: 1 addition & 1 deletion src/Server/Server.php
Expand Up @@ -74,7 +74,7 @@ public function register(RegisterRequest $request, RegisterResponse $response)
*/
public function createSignRequests(RegistrationCollection $registrations)
{
$requests = new SignRequestCollection;
$requests = new SignRequestCollection();
foreach ($registrations as $registration) {
$requests->add(new SignRequest(
$this->config->getVersion(),
Expand Down
4 changes: 2 additions & 2 deletions tests/U2f/Server/RegisterRequestTest.php
Expand Up @@ -11,7 +11,7 @@ class RegisterRequestTest extends \PHPUnit_Framework_TestCase

public function testGetSet()
{
$signRequests = (new SignRequestCollection)->add(new SignRequest('d', 'e', 'f', 'g'));
$signRequests = (new SignRequestCollection())->add(new SignRequest('d', 'e', 'f', 'g'));
$request = new RegisterRequest('a', 'b', 'c', $signRequests);
$this->assertSame('a', $request->getVersion());
$this->assertSame('b', $request->getAppId());
Expand All @@ -24,7 +24,7 @@ public function testJsonSerializable()
{
$this->assertSame(
'{"version":"a","challenge":"Yw","appId":"b"}',
json_encode(new RegisterRequest('a', 'b', 'c', (new SignRequestCollection)->add(new SignRequest('d', 'e', 'f', 'f'))))
json_encode(new RegisterRequest('a', 'b', 'c', (new SignRequestCollection())->add(new SignRequest('d', 'e', 'f', 'f'))))
);
}

Expand Down
6 changes: 3 additions & 3 deletions tests/U2f/Server/RegistrationCollectionTest.php
Expand Up @@ -12,7 +12,7 @@ class RegistrationCollectionTest extends \PHPUnit_Framework_TestCase

public function testGetSet()
{
$registrations = new RegistrationCollection;
$registrations = new RegistrationCollection();
$registrations->add(new Registration($this->getPublicKey(), 'a', 'b'));
$registrations->add(new Registration($this->getPublicKey(), 'c', 'd'));
$this->assertCount(2, $registrations);
Expand All @@ -21,7 +21,7 @@ public function testGetSet()

public function testGetMatchingRegistration()
{
$registrations = new RegistrationCollection;
$registrations = new RegistrationCollection();
$registrations->add($registration = new Registration($this->getPublicKey(), 'a', 'b'));

$this->assertSame($registration, $registrations->getMatchingRegistration(new SignResponse('a', 'abcdef', '{"challenge":"c"}')));
Expand All @@ -33,7 +33,7 @@ public function testGetMatchingRegistration()
*/
public function testNoMatchingRegistration()
{
$registrations = new RegistrationCollection;
$registrations = new RegistrationCollection();
$registrations->add($registration = new Registration($this->getPublicKey(), 'a', 'b'));

$registrations->getMatchingRegistration(new SignResponse('g', 'abcdef', '{"challenge":"c"}'));
Expand Down
42 changes: 21 additions & 21 deletions tests/U2f/Server/ServerTest.php

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions tests/U2f/Server/SignRequestCollectionTest.php
Expand Up @@ -11,7 +11,7 @@ class SignRequestCollectionTest extends \PHPUnit_Framework_TestCase

public function testGetSet()
{
$requests = new SignRequestCollection;
$requests = new SignRequestCollection();
$requests->add(new SignRequest('a', 'b', 'c', 'd'));
$requests->add(new SignRequest('e', 'f', 'g', 'h'));
$this->assertCount(2, $requests);
Expand All @@ -20,7 +20,7 @@ public function testGetSet()

public function testGetMatchingRequest()
{
$requests = new SignRequestCollection;
$requests = new SignRequestCollection();
$requests->add($request = new SignRequest('a', 'b', 'c', 'd'));

$this->assertSame($request, $requests->getMatchingRequest(new SignResponse('d', 'abcdef', '{"challenge":"Yw"}')));
Expand All @@ -30,7 +30,7 @@ public function testJsonSerialize()
{
$this->assertSame(
'[{"version":"a","challenge":"Yw","keyHandle":"ZA","appId":"b"}]',
json_encode((new SignRequestCollection)->add(new SignRequest('a', 'b', 'c', 'd')))
json_encode((new SignRequestCollection())->add(new SignRequest('a', 'b', 'c', 'd')))
);
}

Expand Down

0 comments on commit 1bb9cb5

Please sign in to comment.