/** * @dataProvider mockProviderGetParamsValidation * @param Block $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('[' . BlockTest::getJson() . ']')); $blockList = array(BlockTest::getObject()->getHeight()); /** @noinspection PhpUndefinedVariableInspection */ /** @noinspection PhpParamsInspection */ $obj->get($blockList, $params, $mockApiContext, $mockBlockCypherRestCall); }
/** * @return Block */ public function testGetWithPaging() { $request = $this->operation['response']['body']; $block = new Block($request); $params = array('txstart' => 1, 'limit' => 1); $result = Block::get($block->getHash(), $params, $this->apiContext, $this->mockBlockCypherRestCall); $this->assertNotNull($result); $this->assertInstanceOf('\\BlockCypher\\Api\\Block', $result); // Assert only immutable values. $this->assertEquals($block->getHash(), $result->getHash()); $this->assertEquals($block->getTxUrl(), $result->getTxUrl()); $this->assertEquals(count($block->getTxids()), count($result->getTxids())); return $result; }