/**
  * @return FullAddress
  */
 public function testGet()
 {
     $request = $this->operation['response']['body'];
     $fullAddress = new FullAddress($request);
     $result = FullAddress::get($fullAddress->getAddress(), array(), $this->apiContext, $this->mockBlockCypherRestCall);
     $this->assertNotNull($result);
     $this->assertInstanceOf('\\BlockCypher\\Api\\FullAddress', $result);
     // Assert only immutable values.
     $this->assertEquals($fullAddress->getAddress(), $result->getAddress());
     return $result;
 }
Пример #2
0
 /**
  * @dataProvider mockProviderGetParamsValidation
  * @param FullAddress $obj
  * @param $mockApiContext
  * @param $params
  * @expectedException \InvalidArgumentException
  */
 public function testGetMultipleParamsValidationForParams($obj, $mockApiContext, $params)
 {
     $mockBlockCypherRestCall = $this->getMockBuilder('\\BlockCypher\\Transport\\BlockCypherRestCall')->disableOriginalConstructor()->getMock();
     $mockBlockCypherRestCall->expects($this->any())->method('execute')->will($this->returnValue('[' . FullAddressTest::getJson() . ']'));
     $fullAddressList = array(FullAddressTest::getObject()->getAddress());
     /** @noinspection PhpUndefinedVariableInspection */
     /** @noinspection PhpParamsInspection */
     $obj->get($fullAddressList, $params, $mockApiContext, $mockBlockCypherRestCall);
 }
Пример #3
0
 /**
  * Obtain the FullAddress resource for the given address.
  *
  * @deprecated since version 1.2. Use AddressClient.
  * @param string $address
  * @param array $params Parameters. Options: unspentOnly, and before
  * @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 FullAddress
  */
 public static function getFullAddress($address, $params = array(), $apiContext = null, $restCall = null)
 {
     return FullAddress::get($address, $params, $apiContext, $restCall);
 }
 /**
  * @dataProvider mockProvider
  * @param FullAddress $obj
  */
 public function testGet($obj, $mockApiContext)
 {
     $mockBlockCypherRestCall = $this->getMockBuilder('\\BlockCypher\\Transport\\BlockCypherRestCall')->disableOriginalConstructor()->getMock();
     $mockBlockCypherRestCall->expects($this->any())->method('execute')->will($this->returnValue(FullWalletAsFullAddressTest::getJson()));
     /** @noinspection PhpParamsInspection */
     $result = $obj->get("alice", array(), $mockApiContext, $mockBlockCypherRestCall);
     $this->assertNotNull($result);
     $this->assertInstanceOf('BlockCypher\\Api\\FullAddress', $result);
 }