ubirak / rest-api-behat-extension

Stuff to easily test your rest api with Behat
MIT License
38 stars 24 forks source link

Can I have additional urls? #82

Closed Mpreyzner closed 7 years ago

Mpreyzner commented 7 years ago

For my tests I need to have 2 additional urls (beside base_url). Is it possible to use more than one url?

tyx commented 7 years ago

Hello,

unfortunately it is not possible because it would be a real mess to handle.

But there is a workaround :sunglasses: ! Indeed, the RestApiBrowser will prepend the base_url only if you ask for a path query (like /designs). With complete url (like http://my.api.local/designs), no problem, it will use this url.

// Will request http://base_url/designs
$this->restApiBrowser->sendRequest('GET', '/designs');

// Will request http://my.api.local/designs even if base_url is defined
$this->restApiBrowser->sendRequest('GET', 'http://my.api.local/designs');

Hope it helps