/** * @return WebHook */ public function testCreate() { $request = $this->operation['request']['body']; $obj = new WebHook($request); // Adding a random url request to make it unique $obj->setUrl($obj->getUrl() . '?rand=' . uniqid()); $result = null; try { $result = $obj->create($this->apiContext, $this->mockBlockCypherRestCall); } catch (BlockCypherConnectionException $ex) { $this->fail($ex->getMessage()); } $this->assertNotNull($result); $this->assertInstanceOf('\\BlockCypher\\Api\\WebHook', $result); return $result; }
/** * @dataProvider mockProvider * @param WebHook $obj */ public function testCreate($obj, $mockApiContext) { $mockBlockCypherRestCall = $this->getMockBuilder('\\BlockCypher\\Transport\\BlockCypherRestCall')->disableOriginalConstructor()->getMock(); $mockBlockCypherRestCall->expects($this->any())->method('execute')->will($this->returnValue(self::getJson())); $result = $obj->create($mockApiContext, $mockBlockCypherRestCall); $this->assertNotNull($result); }