Example #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);
 }
 public function testBuild()
 {
     $expectedMicroTX = MicroTXTest::getObject();
     $microTX = MicroTXBuilder::newMicroTX()->fromPubkey($expectedMicroTX->getFromPubkey())->fromPrivate($expectedMicroTX->getFromPrivate())->fromWif($expectedMicroTX->getFromWif())->toAddress($expectedMicroTX->getToAddress())->withValueInSatoshis($expectedMicroTX->getValueSatoshis())->build();
     $this->assertEquals($expectedMicroTX->getFromPubkey(), $microTX->getFromPubkey());
     $this->assertEquals($expectedMicroTX->getFromPrivate(), $microTX->getFromPrivate());
     $this->assertEquals($expectedMicroTX->getFromWif(), $microTX->getFromWif());
     $this->assertEquals($expectedMicroTX->getToAddress(), $microTX->getToAddress());
     $this->assertEquals($expectedMicroTX->getValueSatoshis(), $microTX->getValueSatoshis());
 }