示例#1
0
 /**
  * @dataProvider mockProvider
  * @param WalletClient $obj
  * @param PHPUnit_Framework_MockObject_MockObject|ApiContext $mockApiContext
  * @param PHPUnit_Framework_MockObject_MockObject|BlockCypherRestCall $mockBlockCypherRestCall
  */
 public function testDelete($obj, $mockApiContext, $mockBlockCypherRestCall)
 {
     $mockBlockCypherRestCall->expects($this->any())->method('execute')->will($this->returnValue(true));
     $result = $obj->delete(WalletTest::getObject()->getName(), array(), $mockApiContext, $mockBlockCypherRestCall);
     $this->assertNotNull($result);
 }
<?php

// Run on console:
// php -f .\sample\wallet-api\DeleteWalletEndpoint.php
require __DIR__ . '/../bootstrap.php';
use BlockCypher\Auth\SimpleTokenCredential;
use BlockCypher\Client\WalletClient;
use BlockCypher\Rest\ApiContext;
$apiContext = ApiContext::create('main', 'btc', 'v1', new SimpleTokenCredential('c0afcccdde5081d6429de37d16166ead'), array('mode' => 'sandbox', 'log.LogEnabled' => true, 'log.FileName' => 'BlockCypher.log', 'log.LogLevel' => 'DEBUG'));
$walletClient = new WalletClient($apiContext);
$result = $walletClient->delete('alice');
ResultPrinter::printResult("Delete Wallet Endpoint", "Wallet", 'alice', null, $result);