Esempio n. 1
0
 /**
  * @dataProvider mockProvider
  * @param Address $obj
  */
 public function testGetMultipleWithParams($obj, $mockApiContext)
 {
     $mockBlockCypherRestCall = $this->getMockBuilder('\\BlockCypher\\Transport\\BlockCypherRestCall')->disableOriginalConstructor()->getMock();
     $mockBlockCypherRestCall->expects($this->any())->method('execute')->will($this->returnValue('[' . AddressTest::getJson() . ']'));
     $addressList = array(AddressTest::getObject()->getAddress());
     $params = array('unspentOnly' => 'true', 'before' => 300000);
     $result = $obj->getMultiple($addressList, $params, $mockApiContext, $mockBlockCypherRestCall);
     $this->assertNotNull($result);
     $this->assertEquals($result[0], AddressTest::getObject());
 }
 /**
  * @return Address[]
  */
 public function testGetMultiple()
 {
     $request = $this->operation['response']['body'];
     $addressArray = Address::getList($request);
     $addressList = array();
     /** @var Address $address */
     foreach ($addressArray as $address) {
         $addressList[] = $address->getAddress();
     }
     $result = Address::getMultiple($addressList, array(), $this->apiContext, $this->mockBlockCypherRestCall);
     $this->assertNotNull($result);
     $this->assertContainsOnlyInstancesOf('\\BlockCypher\\Api\\Address', $result);
     $this->assertEquals(count($result), count($addressList));
     foreach ($result as $addr) {
         $this->assertContains($addr->getAddress(), $addressList);
     }
     return $result;
 }