/**
  * @dataProvider mockProvider
  * @param AddressBalance $obj
  */
 public function testGet($obj, $mockApiContext)
 {
     $mockBlockCypherRestCall = $this->getMockBuilder('\\BlockCypher\\Transport\\BlockCypherRestCall')->disableOriginalConstructor()->getMock();
     $mockBlockCypherRestCall->expects($this->any())->method('execute')->will($this->returnValue(WalletBalanceAsAddressBalanceTest::getJson()));
     /** @noinspection PhpParamsInspection */
     $result = $obj->get("alice", array(), $mockApiContext, $mockBlockCypherRestCall);
     $this->assertNotNull($result);
     $this->assertInstanceOf('BlockCypher\\Api\\AddressBalance', $result);
 }
 /**
  * @return AddressBalance
  */
 public function testGet()
 {
     $request = $this->operation['response']['body'];
     $address = new AddressBalance($request);
     $result = AddressBalance::get($address->getAddress(), array(), $this->apiContext, $this->mockBlockCypherRestCall);
     $this->assertNotNull($result);
     $this->assertInstanceOf('\\BlockCypher\\Api\\AddressBalance', $result);
     // Assert only immutable values.
     $this->assertEquals($address->getAddress(), $result->getAddress());
     return $result;
 }
예제 #3
0
 /**
  * @dataProvider mockProviderGetParamsValidation
  * @param AddressBalance $obj
  * @param $mockApiContext
  * @param $params
  * @expectedException \InvalidArgumentException
  */
 public function testGetParamsValidationForParams($obj, $mockApiContext, $params)
 {
     $mockBlockCypherRestCall = $this->getMockBuilder('\\BlockCypher\\Transport\\BlockCypherRestCall')->disableOriginalConstructor()->getMock();
     $mockBlockCypherRestCall->expects($this->any())->method('execute')->will($this->returnValue(AddressBalanceTest::getJson()));
     /** @noinspection PhpUndefinedVariableInspection */
     /** @noinspection PhpParamsInspection */
     $obj->get("1DEP8i3QJCsomS4BSMY2RpU1upv62aGvhD", $params, $mockApiContext, $mockBlockCypherRestCall);
 }
예제 #4
0
 /**
  * Obtain the AddressBalance resource for the given address.
  *
  * @deprecated since version 1.2. Use AddressClient.
  * @param string $address
  * @param array $params Parameters
  * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
  * @param BlockCypherRestCall $restCall is the Rest Call Service that is used to make rest calls
  * @return AddressBalance
  */
 public static function getOnlyBalance($address, $params = array(), $apiContext = null, $restCall = null)
 {
     return AddressBalance::get($address, $params, $apiContext, $restCall);
 }