/**
  * @dataProvider mockProvider
  * @param AddressClient $obj
  * @param PHPUnit_Framework_MockObject_MockObject|ApiContext $mockApiContext
  * @param PHPUnit_Framework_MockObject_MockObject|BlockCypherRestCall $mockBlockCypherRestCall
  */
 public function testGenerateAddress($obj, $mockApiContext, $mockBlockCypherRestCall)
 {
     $mockBlockCypherRestCall->expects($this->any())->method('execute')->will($this->returnValue(AddressKeyChainTest::getJson()));
     $result = $obj->generateAddress($mockApiContext, $mockBlockCypherRestCall);
     $this->assertNotNull($result);
 }
<?php

// Make new address; returns private key/public key/address
// Run on console:
// php -f .\sample\introduction\GenerateBcyAddress.php
require __DIR__ . '/../bootstrap.php';
use BlockCypher\Api\AddressKeyChain;
use BlockCypher\Auth\SimpleTokenCredential;
use BlockCypher\Client\AddressClient;
use BlockCypher\Rest\ApiContext;
$apiContext = ApiContext::create('test', 'bcy', 'v1', new SimpleTokenCredential('c0afcccdde5081d6429de37d16166ead'), array('mode' => 'sandbox', 'log.LogEnabled' => true, 'log.FileName' => 'BlockCypher.log', 'log.LogLevel' => 'DEBUG'));
// For Sample Purposes Only.
$addressKeyChain = new AddressKeyChain();
$request = clone $addressKeyChain;
$addressClient = new AddressClient($apiContext);
$addressKeyChain = $addressClient->generateAddress();
ResultPrinter::printResult("Create Multisig Address", "AddressKeyChain", $addressKeyChain->getAddress(), $request, $addressKeyChain);