/** * @dataProvider mockProvider * @param MicroTXClient $obj * @param PHPUnit_Framework_MockObject_MockObject|ApiContext $mockApiContext * @param PHPUnit_Framework_MockObject_MockObject|BlockCypherRestCall $mockBlockCypherRestCall */ public function testFromWif($obj, $mockApiContext, $mockBlockCypherRestCall) { $mockBlockCypherRestCall->expects($this->any())->method('execute')->will($this->returnValue(MicroTXTest::getJson())); /** @noinspection SpellCheckingInspection */ $result = $obj->sendWithWif("BpouCdZ5dXbjcUDQBj8ZVYBbSPtWYDQHxuDcP48VA6Q7dZuqW4UJ", "C4MYFr4EAdqEeUKxTnPUF3d3whWcPMz1Fi", 10000, $mockApiContext, $mockBlockCypherRestCall); $this->assertNotNull($result); }
/** * @dataProvider mockProvider * @param FaucetClient $obj * @param PHPUnit_Framework_MockObject_MockObject|ApiContext $mockApiContext * @param PHPUnit_Framework_MockObject_MockObject|BlockCypherRestCall $mockBlockCypherRestCall */ public function testFundAddress($obj, $mockApiContext, $mockBlockCypherRestCall) { $mockBlockCypherRestCall->expects($this->any())->method('execute')->will($this->returnValue(FaucetResponseTest::getJson())); $faucetResponse = FaucetResponseTest::getObject(); $result = $obj->fundAddress('CFqoZmZ3ePwK5wnkhxJjJAQKJ82C7RJdmd', 100000, $mockApiContext, $mockBlockCypherRestCall); $this->assertNotNull($result); $this->assertEquals($faucetResponse, $result); }
/** * @dataProvider mockProvider * @param WebHookClient $obj * @param PHPUnit_Framework_MockObject_MockObject|ApiContext $mockApiContext * @param PHPUnit_Framework_MockObject_MockObject|BlockCypherRestCall $mockBlockCypherRestCall */ public function testDelete($obj, $mockApiContext, $mockBlockCypherRestCall) { $mockBlockCypherRestCall->expects($this->any())->method('execute')->will($this->returnValue(true)); $result = $obj->delete(WebHookTest::getObject()->getId(), $mockApiContext, $mockBlockCypherRestCall); $this->assertNotNull($result); }
/** * @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 testGetMultipleFullAddressesParamsValidationForParams($obj, $mockApiContext, $mockBlockCypherRestCall, $params) { $mockBlockCypherRestCall->expects($this->any())->method('execute')->will($this->returnValue('[' . FullAddressTest::getJson() . ']')); $fullAddressList = array(FullAddressTest::getObject()->getAddress()); $obj->getMultipleFullAddresses($fullAddressList, $params, $mockApiContext, $mockBlockCypherRestCall); }
/** * @dataProvider mockProviderGetParamsValidation * @param BlockClient $obj * @param PHPUnit_Framework_MockObject_MockObject|ApiContext $mockApiContext * @param PHPUnit_Framework_MockObject_MockObject|BlockCypherRestCall $mockBlockCypherRestCall * @param $params * @expectedException \InvalidArgumentException */ public function testGetParamsValidationForParams($obj, $mockApiContext, $mockBlockCypherRestCall, $params) { $mockBlockCypherRestCall->expects($this->any())->method('execute')->will($this->returnValue(BlockchainTest::getJson())); $obj->get(BlockchainTest::getObject()->getName(), $params, $mockApiContext, $mockBlockCypherRestCall); }
/** * @dataProvider mockProvider * @param BlockchainClient $obj * @param PHPUnit_Framework_MockObject_MockObject|ApiContext $mockApiContext * @param PHPUnit_Framework_MockObject_MockObject|BlockCypherRestCall $mockBlockCypherRestCall */ public function testGetFeature($obj, $mockApiContext, $mockBlockCypherRestCall) { $mockBlockCypherRestCall->expects($this->any())->method('execute')->will($this->returnValue(self::featureResponse())); $result = $obj->getFeature('bip65', array(), $mockApiContext, $mockBlockCypherRestCall); $this->assertEquals(self::featureResponse(), $result); }
/** * @dataProvider mockProviderGetParamsValidation * @param TXClient $obj * @param PHPUnit_Framework_MockObject_MockObject|ApiContext $mockApiContext * @param PHPUnit_Framework_MockObject_MockObject|BlockCypherRestCall $mockBlockCypherRestCall * @param $params * @expectedException \InvalidArgumentException */ public function testGetMultipleConfidenceParamsValidationForParams($obj, $mockApiContext, $mockBlockCypherRestCall, $params) { $mockBlockCypherRestCall->expects($this->any())->method('execute')->will($this->returnValue('[' . TXConfidenceTest::getJson() . ']')); $txConfidenceList = array(TXConfidenceTest::getObject()->getTxhash()); $obj->getMultipleConfidences($txConfidenceList, $params, $mockApiContext, $mockBlockCypherRestCall); }
/** * @dataProvider mockProvider * @param NullDataClient $obj * @param PHPUnit_Framework_MockObject_MockObject|ApiContext $mockApiContext * @param PHPUnit_Framework_MockObject_MockObject|BlockCypherRestCall $mockBlockCypherRestCall */ public function testEmbedHex($obj, $mockApiContext, $mockBlockCypherRestCall) { $mockBlockCypherRestCall->expects($this->any())->method('execute')->will($this->returnValue(NullDataTest::getJsonWithHexData())); $result = $obj->embedHex(NullDataTest::getObjectWithHexData()->getData(), array(), $mockApiContext, $mockBlockCypherRestCall); $this->assertNotNull($result); }
/** * @dataProvider mockProvider * @param BlockClient $obj * @param PHPUnit_Framework_MockObject_MockObject|ApiContext $mockApiContext * @param PHPUnit_Framework_MockObject_MockObject|BlockCypherRestCall $mockBlockCypherRestCall */ public function testGetMultipleWithParams($obj, $mockApiContext, $mockBlockCypherRestCall) { $mockBlockCypherRestCall->expects($this->any())->method('execute')->will($this->returnValue('[' . BlockTest::getJson() . ']')); $blockList = array(BlockTest::getObject()->getHeight()); $params = array('txstart' => 1, 'limit' => 1); $result = $obj->getMultiple($blockList, $params, $mockApiContext, $mockBlockCypherRestCall); $this->assertNotNull($result); $this->assertEquals($result[0], BlockTest::getObject()); }