8000 Add a way to unset server parameters in BrowserKit\Client · Issue #20306 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
8000

Add a way to unset server parameters in BrowserKit\Client #20306

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

Closed
taylankasap opened this issue Oct 26, 2016 · 7 comments
Closed

Add a way to unset server parameters in BrowserKit\Client #20306

taylankasap opened this issue Oct 26, 2016 · 7 comments

Comments

@taylankasap
Copy link
Contributor
taylankasap commented Oct 26, 2016

I think the title is self-explanatory. E.g. this method would be useful if it existed:

\Symfony\Component\BrowserKit\Client::unsetServerParameter($key)

The request is different if I use setServerParameter($key, null), so not the same thing.

See this Stack Overflow answer for a use case.

@fabpot
Copy link
Member
fabpot commented Dec 13, 2016

I think I would prefer a more idiomatic way to submit a form via Ajax instead like having a specific method to switch to an "Ajax mode" for the very next request.

@taylankasap
Copy link
Contributor Author

@fabpot I agree. It was just a use case example. I'm sure there will be other use cases for unset.

@fabpot
Copy link
Member
fabpot commented Dec 13, 2016

But we never add a feature without use cases. So, let's fix the one we have now instead of adding a generic unset which should really never be needed (here we try to simulate a browser and you cannot unset anything there).

@taylankasap
Copy link
Contributor Author

Okay, why do we have set? We can already set things in the constructor. If we don't need to unset dynamically, why do we need to set dynamically?

I mean unset is just a complementary method. If we have set we should have unset, if we don't have set we shouldn't have unset. What do you think?

@fabpot
Copy link
Member
fabpot commented Dec 13, 2016

I don't understand why we should have unset just because we have set. Anyway, without any real-world use cases, I won't add unset.

@Simperfit
Copy link
Contributor

@fabpot So can we change this feature into adding a method that allow people to switch to an ajax mode like you said ?

@fabpot
Copy link
Member
fabpot commented Dec 14, 2016

Yes

@fabpot fabpot closed this as completed Feb 19, 2018
fabpot added a commit that referenced this issue Feb 19, 2018
…st (Simperfit)

This PR was merged into the 4.1-dev branch.

Discussion
----------

[BrowserKit] add a way to switch to ajax for one request

| Q             | A
| ------------- | ---
| Branch?       | 4.1
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #20306
| License       | MIT
| Doc PR        | will do

Follow the work on #20306.

/cc @fabpot is it the right implementation ?

Commits
-------

a10eae7 [BrowserKit] add a way to switch to ajax for one request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants
0