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