/** * @return Blockchain */ public function testGet() { $request = $this->operation['response']['body']; $blockchain = new Blockchain($request); $result = Blockchain::get($blockchain->getName(), array(), $this->apiContext, $this->mockBlockCypherRestCall); $this->assertNotNull($result); $this->assertInstanceOf('\\BlockCypher\\Api\\Blockchain', $result); // Assert only immutable values. $this->assertEquals($blockchain->getName(), $result->getName()); return $result; }
/** * @dataProvider mockProviderGetParamsValidation * @param Blockchain $obj * @param $mockApiContext * @param $params * @expectedException \InvalidArgumentException */ public function testGetParamsValidationForParams($obj, $mockApiContext, $params) { $mockBlockCypherRestCall = $this->getMockBuilder('\\BlockCypher\\Transport\\BlockCypherRestCall')->disableOriginalConstructor()->getMock(); $mockBlockCypherRestCall->expects($this->any())->method('execute')->will($this->returnValue(BlockchainTest::getJson())); /** @noinspection PhpUndefinedVariableInspection */ /** @noinspection PhpParamsInspection */ $obj->get("BTC.main", $params, $mockApiContext, $mockBlockCypherRestCall); }