예제 #1
0
 /**
  * @dataProvider mockProvider
  * @param Address $obj
  */
 public function testGetOnlyBalance($obj, $mockApiContext)
 {
     $mockBlockCypherRestCall = $this->getMockBuilder('\\BlockCypher\\Transport\\BlockCypherRestCall')->disableOriginalConstructor()->getMock();
     $mockBlockCypherRestCall->expects($this->any())->method('execute')->will($this->returnValue(AddressBalanceTest::getJson()));
     $address = AddressBalanceTest::getObject();
     /** @noinspection PhpParamsInspection */
     $result = $obj->getOnlyBalance($address->getAddress(), array(), $mockApiContext, $mockBlockCypherRestCall);
     $this->assertNotNull($result);
     $this->assertEquals($address, $result);
 }
예제 #2
0
 /**
  * @return AddressBalance
  */
 public function testGetOnlyBalance()
 {
     $request = $this->operation['response']['body'];
     $addressBalance = new AddressBalance($request);
     $result = Address::getOnlyBalance($addressBalance->getAddress(), array(), $this->apiContext, $this->mockBlockCypherRestCall);
     $this->assertNotNull($result);
     $this->assertInstanceOf('\\BlockCypher\\Api\\AddressBalance', $result);
     // Assert only immutable values.
     $this->assertEquals($addressBalance->getAddress(), $result->getAddress());
     return $result;
 }