/** * @dataProvider mockProviderGetParamsValidation * @param AddressClient $obj * @param PHPUnit_Framework_MockObject_MockObject|ApiContext $mockApiContext * @param PHPUnit_Framework_MockObject_MockObject|BlockCypherRestCall $mockBlockCypherRestCall * @param $params * @expectedException \InvalidArgumentException */ public function testGetMultipleBalancesParamsValidationForParams($obj, $mockApiContext, $mockBlockCypherRestCall, $params) { $mockBlockCypherRestCall->expects($this->any())->method('execute')->will($this->returnValue('[' . AddressBalanceTest::getJson() . ']')); $addressBalanceList = array(AddressBalanceTest::getObject()->getAddress()); $obj->getMultipleBalances($addressBalanceList, $params, $mockApiContext, $mockBlockCypherRestCall); }
/** * @dataProvider mockProviderGetParamsValidation * @param AddressBalance $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('[' . AddressBalanceTest::getJson() . ']')); $addressBalanceList = array(AddressBalanceTest::getObject()->getAddress()); /** @noinspection PhpUndefinedVariableInspection */ /** @noinspection PhpParamsInspection */ $obj->getMultiple($addressBalanceList, $params, $mockApiContext, $mockBlockCypherRestCall); }
/** * @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); }