Skip to content
This repository was archived by the owner on Jan 8, 2020. It is now read-only.

Conversation

@afeder
Copy link

@afeder afeder commented May 3, 2015

Fixes #7472.

@Martin-P
Copy link
Contributor

Martin-P commented May 3, 2015

This PR needs unittests.

@afeder
Copy link
Author

afeder commented May 3, 2015

Does any guidance exist as to what kinds of unit tests would be needed?

@samsonasik
Copy link
Contributor

need rebase

@afeder
Copy link
Author

afeder commented May 3, 2015

samsonasik: Indeed. Done.

@afeder
Copy link
Author

afeder commented May 3, 2015

I added a test for the issue described in #7472.

@samsonasik
Copy link
Contributor

need rebase again

@afeder
Copy link
Author

afeder commented May 9, 2015

Rebase done.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@return HttpUri , not ?

@Martin-P
Copy link
Contributor

Martin-P commented May 9, 2015

IMO this needs PR needs many more tests.

There are multiple new methods introduced in Zend\Http\Request which are not tested at all:

  • setOptions
  • setArgSeparator
  • getArgSeparator
  • renderQueryString
  • renderUri

A big chunk of code in Zend\Http\Client has been removed and new code is added, but no tests have been added for this.

The only test which has been added is a very basic query string example. What happens with more advanced query strings? Does that work too or will it fail?

@afeder
Copy link
Author

afeder commented May 9, 2015

If you share with me what tests you are looking for I shall add them right away.

The big chunks of code being removed or added is little more than migrating the URI building logic from the Client class into the Request class.

I've found two existing tests pertaining to this code which I've now copied over to the tests for the Request class. I've also expanded the query test to cover the case of multiple query parameters being set, and duplicated this test for the renderUri() and renderQueryString() functions.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be Exception\InvalidArgumentException, please add test too.

@afeder
Copy link
Author

afeder commented May 12, 2015

I fixed the exception in the setOptions() function per sasezaki's comment. As for testing the function, none exist for the original code in Client.php, but I added a basic one anyway.

@afeder afeder changed the title Zend http proper uri rendering Zend/Http proper URI rendering May 12, 2015
@afeder afeder changed the title Zend/Http proper URI rendering Proper URI rendering for Zend/Http May 12, 2015
@weierophinney weierophinney removed this from the 2.5.0 milestone Jun 3, 2015
@GeeH
Copy link

GeeH commented Jun 28, 2016

This issue has been moved from the zendframework repository as part of the bug migration program as outlined here - http://framework.zend.com/blog/2016-04-11-issue-closures.html
New issue can be found at: zendframework/zend-http#68

@GeeH GeeH closed this Jun 28, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants