/** * @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); }
/** * @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; }