Beispiel #1
0
 /**
  * @dataProvider mockProviderGetParamsValidation
  * @param TX $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('[' . TXTest::getJson() . ']'));
     $transactionList = array(AddressTest::getObject()->getAddress());
     /** @noinspection PhpUndefinedVariableInspection */
     /** @noinspection PhpParamsInspection */
     $obj->get($transactionList, $params, $mockApiContext, $mockBlockCypherRestCall);
 }
Beispiel #2
0
 /**
  * @depends testSerializationDeserialization
  * @param TXSkeleton $obj
  */
 public function testGetters($obj)
 {
     $this->assertEquals($obj->getTx(), TXTest::getObject());
     $this->assertEquals($obj->getTosign(), array("7e6a71a683f303b6a659daa8009c81c47edd2b14f59b938cb31f8ef2a3e129f5"));
     $this->assertEquals($obj->getSignatures(), array("30450221008627dbea1b070e8ceb025ab0ecb154227a65a34e6e8cd64966f181ca151d354f022066264b1930ad9e638f2853db683f5f81059e8c547bf9b4512046d2525c170c0b"));
     $this->assertEquals($obj->getPubkeys(), array("0274cb62e999bdf96c9b4ef8a2b44c1ac54d9de879e2ee666fdbbf0e1a03090cdf"));
     $this->assertEquals($obj->getError(), "message");
     $this->assertEquals($obj->getErrors(), array());
 }
 /**
  * @depends testSerializationDeserialization
  * @param FullAddress $obj
  */
 public function testGetters($obj)
 {
     $this->assertEquals($obj->getAddress(), "1DEP8i3QJCsomS4BSMY2RpU1upv62aGvhD");
     $this->assertEquals($obj->getTotalReceived(), 4433416);
     $this->assertEquals($obj->getTotalSent(), 0);
     $this->assertEquals($obj->getBalance(), 4433416);
     $this->assertEquals($obj->getUnconfirmedBalance(), 0);
     $this->assertEquals($obj->getFinalBalance(), 0);
     $this->assertEquals($obj->getNTx(), 7);
     $this->assertEquals($obj->getUnconfirmedNTx(), 0);
     $this->assertEquals($obj->getFinalNTx(), 7);
     $this->assertEquals($obj->getTxs(), array(TXTest::getObject()));
 }
Beispiel #4
0
 /**
  * @dataProvider mockProvider
  * @param TXClient $obj
  * @param PHPUnit_Framework_MockObject_MockObject|ApiContext $mockApiContext
  * @param PHPUnit_Framework_MockObject_MockObject|BlockCypherRestCall $mockBlockCypherRestCall
  */
 public function testCreate($obj, $mockApiContext, $mockBlockCypherRestCall)
 {
     $mockBlockCypherRestCall->expects($this->any())->method('execute')->will($this->returnValue(TXSkeletonTest::getJson()));
     $result = $obj->create(TXTest::getObject(), $mockApiContext, $mockBlockCypherRestCall);
     $this->assertNotNull($result);
     $this->assertInstanceOf('\\BlockCypher\\Api\\TXSkeleton', $result);
 }