Imported code from old repository
This commit is contained in:
33
tests/OfflineTests/AccountGateway/AccountContextTest.php
Normal file
33
tests/OfflineTests/AccountGateway/AccountContextTest.php
Normal 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'));
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user