-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
Add browserkit component documentation #4312
Conversation
single: Components; BrowserKit | ||
|
||
The BrowserKit Component | ||
========================= |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 1 x =
This month is pretty busy so progress will be a little slow. What topics in particular do you think I should include in the documentation? |
The most important part is explaining how the component works (by using a Client to simulate the HTTP layer). This means you have to explain that you need to create a new client by extending /**
* Makes a request.
*
* @param object $request An origin request instance
*
* @return object An origin response instance
*/
abstract protected function doRequest($request); Then you need to tell something about the After that, you can talk about some more advanced topics like using One tip: Look at how Symfony, Laravel and Goutte implemented the Client for examples and look at the tests on how these classes work. |
Btw, I think it is worth linking to the 2 existing implementations of the BrowserKit client:
|
|
||
For an implementation based on HttpKernelInterface, have a look at the Client provided by the :doc:`/components/http_kernel/introduction`. | ||
|
||
.. _Packagist: https://packagist.org/packages/symfony/event-dispatcher |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wrong link
ping @yamiko-ninja do you have time in the future to bring this PR to the next level? If not, please say so, then someone else can take it over. |
@wouterj ahh forgot about it! If someone wants to take over they can. otherwise I will put this on my todo list to do by the end of April. About to move in a few weeks. |
Hi @yamiko-ninja! Just wanted to let you know that there will be a doc sprint day on May 23rd. You can join in then to get quick feedback & other help. If you no longer have the motivation/time to finish this PR, we can also put it on the list for other people to take over. Thanks for the bootstrapping! |
I will put that day on my calendar and will do some more work on it in the meantime. I have time to work on this again now. |
@wouterj I have some concerns about this PR. @yamiko-ninja has done a great work bootstraping the documentation of the component. However, if we expect him to complete all the documentation, maybe that's too much for a single person (hence my concerns). What do you think if we lower the expectations of this PR to consider it just the bootstraping of the component documentation. That way we can polish @yamiko-ninja's current work a bit and merge it. Then, we outline all the contents we want to add to this section and complete that task in further pull requests. |
I agree with you @javiereguiluz for two reasons:
|
I agree. I have only made a few contributions here and there I would be fine with someone else taking over. I am also not very knowledgeable about this component so I have been adding docs whenever I learn something about it. |
|
||
.. code-block:: php | ||
|
||
namespace ACME; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be AppBundle
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, we are in the components section here. It should not use framework things like bundles
I added in some docs on cookies. I think this is a good start and other can add more to it if they like. With that in mind I removed the [WIP] from the title. |
|
||
The BrowserKit component simulates the behavior of a web browser. | ||
|
||
The BrowserKit component allows you to make web request, click on links and submit forms. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
requests
Installation | ||
------------ | ||
|
||
You can install the component in 2 different ways: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"two" instead of "2"
This looks pretty good so far. Thanks for your work @yamiko-ninja! I have left you a few comments (I wasn't able to look into this too deeply yet). And could you please also update this so that each lines is wrapped after the first word that crosses the 72nd character? |
@xabbuh thanks for all the corrections. I will make the changes over the weekend. |
@yamiko-ninja you did a great work in this pull request. We just need a final push to finish it. That's what I'm trying to do in #6072. I've reused your original commits, so you'll get full credit for your work once the other pull request is merged. Thanks! |
…ninja, robert Parker, javiereguiluz) This PR was merged into the 2.3 branch. Discussion ---------- Add browserkit component documentation | Q | A | ------------- | --- | Doc fix? | no | New docs? | yes | Applies to | all | Fixed tickets | - This PR tries to finish the fantastic work made by @yamiko-ninja in #4312. Please review it so I can improve/finish it and we can merge it before year's end. Thanks! Commits ------- 3f0858f Fixed a syntax issue c9093a8 Implemented changes suggested by Wouter e7056a8 Fixed a reference 5aec7c4 Minor fixes fd35c93 Fixed a syntax issue 883c062 Finished the first version of the BrowserKit doc 03ea5a5 fix title underline a1df783 spelling and formating ea3fd71 Adding documentation for cookies 6b6e23a added docs on histroy a3d158e added form submissions and moved creating a client to top 74cfecd more outlines, fixed link, added more about creating a client dda78ba added a link snippit 94bb3bf fixed spelling 6997c4f make a basic request b3d9eb3 added links to index and map files f0f8a50 added links with info about clients and packagist link 1e5ca13 added in sections that I apln to fill out 9c007e9 syntax fix 645d50d fixed a few mistakes 93d7258 added introduction
Working on documentation for the browser kit. Fixes #954
Pull request #4310 was to the wrong branch so making a new one