/** * @dataProvider deleteProvider * @covers Datasift_Account_Identity::delete */ public function testDelete($identityId, $apiResult, $expectedResult) { $identity = new DataSift_Account_Identity($this->_user); DataSift_MockApiClient::setResponse($apiResult); if (isset($expectedResult['error'])) { $this->setExpectedException('DataSift_Exception_APIError'); } $result = $identity->delete($identityId); $this->assertEquals($expectedResult, $result); }
echo "\nUpdating limit...\n"; $res = $limit->update($id, $service, 10000); echo $res['id'] . " - " . $res['service'] . " - " . $res['total_allowance'] . " - " . $res['analyze_queries'] . "\n"; unset($res); echo "\nDeleting limit...\n"; $res = $limit->delete($id, $service); if ($res === true) { echo "Deleted\n"; } unset($res); echo "\nDeleting token...\n"; $res = $token->delete($id, 'facebook'); if ($res === true) { echo "Deleted\n"; } unset($res); echo "\nDeleting identity...\n"; $res = $identity->delete($id); if ($res === true) { echo "Deleted\n"; } unset($res); echo "\nGetting identities...\n"; $res = $identity->getAll(); foreach ($res['identities'] as $r) { echo $r['id'] . " - " . $r['label'] . "\n"; } unset($res); } catch (Exception $e) { print_r($e->getMessage()); }