Imported code from old repository

This commit is contained in:
2022-11-17 11:48:29 +01:00
parent 14dfa45240
commit 0e4ab60d77
31 changed files with 6486 additions and 253 deletions

View File

@@ -0,0 +1,34 @@
<?php
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
namespace CloudObjects\SDK\AccountGateway;
use GuzzleHttp\Psr7\Request as GuzzlePsrRequest;
use Symfony\Component\HttpFoundation\Request as SymfonyRequest;
class AccountContextParseTest extends \PHPUnit_Framework_TestCase {
public function testParsePsrRequest() {
$request = new GuzzlePsrRequest('GET', '/', [
'C-AAUID' => '1234123412341234', 'C-Access-Token' => 'test'
]);
$context = AccountContext::fromPsrRequest($request);
$this->assertNotNull($context);
$this->assertEquals('1234123412341234', AAUIDParser::getAAUID($context->getAAUID()));
}
public function testParseSymfonyRequest() {
$request = SymfonyRequest::create('/', 'GET', [], [], [], [
'HTTP_C_AAUID' => '1234123412341234', 'HTTP_C_ACCESS_TOKEN' => 'test'
]);
$context = AccountContext::fromSymfonyRequest($request);
$this->assertNotNull($context);
$this->assertEquals('1234123412341234', AAUIDParser::getAAUID($context->getAAUID()));
}
}