Exemplo n.º 1
0
 /**
  * @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);
 }
Exemplo n.º 2
0
 /**
  * @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);
 }
Exemplo n.º 3
0
 /**
  * @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);
 }
Exemplo n.º 4
0
 /**
  * @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);
 }
Exemplo n.º 5
0
 /**
  * @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);
 }
Exemplo n.º 7
0
 /**
  * @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);
 }
Exemplo n.º 8
0
 /**
  * @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);
 }
Exemplo n.º 9
0
 /**
  * @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());
 }