-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
testing different params for testing similar response #40
Comments
Can you post some code examples. It’s very difficult for me to help without that. |
For example the following hook is written twice because I want to test same 403 response for two different requests. Hooks::before("sites > /api/sites/{id}.json > submits changes to existing site > 403 > application/json; charset=utf-8", function(&$transaction)
{
//calls with wrong ID
$transaction->skip = false;
$transaction->fullPath = $transaction->request->uri = '/api/sites/21999.json?token=' . 'goodtoken';
}
Hooks::before("sites > /api/sites/{id}.json > submits changes to existing site > 403 > application/json; charset=utf-8", function(&$transaction)
{
//calls with validation errors
$transaction->skip = false;
$transaction->fullPath = $transaction->request->uri = '/api/sites/21.json?token=' . 'goodtoken';
} Only the first API call is made. The second one does not. Even though the hook itself is called but not the API. |
Hi @thevikas for this purpose, I use this hack, hope it will help you:
|
I found out that clone not working here, I used another hack unserialize(serialize($transaction)); and now it works (I hope :)) |
I wish to test few errors and all these errors result in same http response code.
I'm using hooks and can't get it to run second time.
For e.g. 403 is returned for many reasons. I want to test two and dredd only runs for first test and forgets other.
Please help.
The text was updated successfully, but these errors were encountered: