/** * @depends testGet * @param $webHook WebHook * @return WebHook[] */ public function testGetAll($webHook) { $result = WebHook::getAll(array(), $this->apiContext, $this->mockBlockCypherRestCall); $this->assertNotNull($result); $found = false; $foundObject = null; foreach ($result as $webHookObject) { if ($webHookObject->getId() == $webHook->getId()) { $found = true; $foundObject = $webHookObject; break; } } $this->assertTrue($found, "The Created WebHook was not found in the get list"); $this->assertEquals($webHook->getId(), $foundObject->getId()); return $result; }
/** * @dataProvider mockProvider * @param WebHook $obj */ public function testGetAll($obj, $mockApiContext) { $mockBlockCypherRestCall = $this->getMockBuilder('\\BlockCypher\\Transport\\BlockCypherRestCall')->disableOriginalConstructor()->getMock(); $mockBlockCypherRestCall->expects($this->any())->method('execute')->will($this->returnValue('[' . WebHookTest::getJson() . ']')); $result = $obj->getAll(array(), $mockApiContext, $mockBlockCypherRestCall); $this->assertNotNull($result); $this->assertNotNull($result); $this->assertEquals($result[0], WebHookTest::getObject()); }