/**
  * @return TXConfidence[]
  */
 public function testGetMultiple()
 {
     $request = $this->operation['response']['body'];
     $txConfidenceArray = TXConfidence::getList($request);
     $txConfidenceList = array();
     /** @var TXConfidence $txConfidence */
     foreach ($txConfidenceArray as $txConfidence) {
         $txConfidenceList[] = $txConfidence->getTxhash();
     }
     $result = TXConfidence::getMultiple($txConfidenceList, array(), $this->apiContext, $this->mockBlockCypherRestCall);
     $this->assertNotNull($result);
     $this->assertContainsOnlyInstancesOf('\\BlockCypher\\Api\\TXConfidence', $result);
     $this->assertEquals(count($result), count($txConfidenceList));
     foreach ($result as $resultTxConfidence) {
         $this->assertContains($resultTxConfidence->getTxhash(), $txConfidenceList);
     }
     return $result;
 }
Ejemplo n.º 2
0
 /**
  * @dataProvider mockProviderGetParamsValidation
  * @param TXConfidence $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('[' . TXConfidenceTest::getJson() . ']'));
     $txConfidenceList = array(TXConfidenceTest::getObject()->getTxhash());
     /** @noinspection PhpUndefinedVariableInspection */
     /** @noinspection PhpParamsInspection */
     $obj->getMultiple($txConfidenceList, $params, $mockApiContext, $mockBlockCypherRestCall);
 }