/**
  * @return TX[]
  */
 public function testGetMultiple()
 {
     $request = $this->operation['response']['body'];
     $transactionArray = TX::getList($request);
     $transactionList = array();
     /** @var TX $transaction */
     foreach ($transactionArray as $transaction) {
         $transactionList[] = $transaction->getHash();
     }
     $result = TX::getMultiple($transactionList, array(), $this->apiContext, $this->mockBlockCypherRestCall);
     $this->assertNotNull($result);
     $this->assertContainsOnlyInstancesOf('\\BlockCypher\\Api\\TX', $result);
     $this->assertEquals(count($result), count($transactionList));
     foreach ($result as $tx) {
         $this->assertContains($tx->getHash(), $transactionList);
     }
     return $result;
 }
Exemple #2
0
 /**
  * @dataProvider mockProvider
  * @param TX $obj
  */
 public function testGetMultipleWithParams($obj, $mockApiContext)
 {
     $mockBlockCypherRestCall = $this->getMockBuilder('\\BlockCypher\\Transport\\BlockCypherRestCall')->disableOriginalConstructor()->getMock();
     $mockBlockCypherRestCall->expects($this->any())->method('execute')->will($this->returnValue('[' . TXTest::getJson() . ']'));
     $transactionList = array(AddressTest::getObject()->getAddress());
     $params = array('instart' => 1, 'outstart' => 1, 'limit' => 1);
     $result = $obj->getMultiple($transactionList, $params, $mockApiContext, $mockBlockCypherRestCall);
     $this->assertNotNull($result);
     $this->assertEquals($result[0], TXTest::getObject());
 }