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,33 @@
<?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 ML\IRI\IRI;
class AccountContextTest extends \PHPUnit_Framework_TestCase {
private $context;
protected function setUp() {
$this->context = new AccountContext(new IRI('aauid:aaaabbbbccccdddd'), 'DUMMY');
}
public function testDefaultGatewayBaseURL() {
$this->assertEquals('https://aaaabbbbccccdddd.aauid.net', $this->context->getClient()->getConfig('base_uri'));
}
public function testSetAccountGatewayBaseURLTemplateWithPlaceholder() {
$this->context->setAccountGatewayBaseURLTemplate('http://{aauid}.localhost');
$this->assertEquals('http://aaaabbbbccccdddd.localhost', $this->context->getClient()->getConfig('base_uri'));
}
public function testSetAccountGatewayBaseURLTemplateWithoutPlaceholder() {
$this->context->setAccountGatewayBaseURLTemplate('http://localhost');
$this->assertEquals('http://localhost', $this->context->getClient()->getConfig('base_uri'));
}
}