Added available currencies and updated the constructor and setCode to the currency class Added phpmd to project Updated documentation to some some conventions, updated docs to show the new usage of the currency class, also updated the testing documentation to show how to use phpmd Small bug fix and made the configuration file have 100% code coverage Code cleanup, removed unused variables Updated dev dependencies to patch level Removed the sin_key option since it will be going away soon Removed Robo in composer.json since we do not use and updated travis config to allow failures in php 5.3 since we require 5.4 or greater Deleted robo file Large update with documentation updates, extra code functionality, and bug fixes.
76 lines
2.1 KiB
PHP
76 lines
2.1 KiB
PHP
<?php
|
|
/**
|
|
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
|
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
|
*/
|
|
|
|
namespace Bitpay\Config;
|
|
|
|
use Symfony\Component\Config\Definition\Processor;
|
|
|
|
class ConfigurationTest extends \PHPUnit_Framework_TestCase
|
|
{
|
|
public function testProcessAndValidate()
|
|
{
|
|
$processor = new Processor();
|
|
$processedConfig = $processor->processConfiguration(
|
|
new Configuration(),
|
|
array()
|
|
);
|
|
|
|
$this->assertArrayHasKey('public_key', $processedConfig);
|
|
$this->assertArrayHasKey('private_key', $processedConfig);
|
|
$this->assertArrayHasKey('sin_key', $processedConfig);
|
|
$this->assertArrayHasKey('network', $processedConfig);
|
|
$this->assertArrayHasKey('adapter', $processedConfig);
|
|
$this->assertArrayHasKey('key_storage', $processedConfig);
|
|
$this->assertArrayHasKey('key_storage_password', $processedConfig);
|
|
$this->assertCount(7, $processedConfig);
|
|
}
|
|
|
|
/**
|
|
* @expectedException Exception
|
|
*/
|
|
public function testClassNotFoundKeyStorageConfig()
|
|
{
|
|
$processor = new Processor();
|
|
$processor->processConfiguration(
|
|
new Configuration(),
|
|
array(
|
|
'bitpay' => array(
|
|
'key_storage' => 'Foo\Bar'
|
|
)
|
|
)
|
|
);
|
|
}
|
|
|
|
/**
|
|
* @expectedException Exception
|
|
*/
|
|
public function testClassDoesNotImplementInterfaceKeyStorageConfig()
|
|
{
|
|
$processor = new Processor();
|
|
$processor->processConfiguration(
|
|
new Configuration(),
|
|
array(
|
|
'bitpay' => array(
|
|
'key_storage' => 'stdClass'
|
|
)
|
|
)
|
|
);
|
|
}
|
|
|
|
public function testAcceptableKeyStorageConfig()
|
|
{
|
|
$processor = new Processor();
|
|
$processor->processConfiguration(
|
|
new Configuration(),
|
|
array(
|
|
'bitpay' => array(
|
|
'key_storage' => '\\Bitpay\\Storage\\EncryptedFilesystemStorage'
|
|
)
|
|
)
|
|
);
|
|
}
|
|
}
|