-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[WIP]BrowserKit] added a test to make sure HTTP authentication is preserved #7059
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
Conversation
$crawler = $client->request('GET', 'http://www.example.com/foo/foobar', array(), array(), array('PHP_AUTH_USER' => 'foo', 'PHP_AUTH_PW' => 'bar')); | ||
|
||
$server = $client->getRequest()->getServer(); | ||
$this->assertTrue(isset($server['PHP_AUTH_USER'])); |
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.
``assertArrayHasKey will give a better failure message
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.
I didn't know this method existed :) thanks 👍
…ed when submitting a form
Thanks. Could you add a "[WIP]" prefix to the PR tittle and set "bug fix" to "no" for now ? |
done 👍 |
This cannot be related to #6995 as your test does not involve any HttpFoundation classes. |
This PR was merged into the 2.2 branch. Commits ------- b240d1f [BrowserKit] added a test to make sure HTTP authentication is preserved when submitting a form Discussion ---------- [WIP]BrowserKit] added a test to make sure HTTP authentication is preserved | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | no | Fixed tickets | | License | MIT | Doc PR | Since #6995 BrowseKit no longer seems to preserve the HTTP authentication when submitting a form. This PR adds a test to demonstrate the failure. --------------------------------------------------------------------------- by vicb at 2013-02-13T12:49:16Z Thanks. Could you add a "[WIP]" prefix to the PR tittle and set "bug fix" to "no" for now ? --------------------------------------------------------------------------- by sstok at 2013-02-13T13:59:42Z done :+1: --------------------------------------------------------------------------- by fabpot at 2013-02-17T12:49:35Z This cannot be related to #6995 as your test does not involve any HttpFoundation classes.
See 5bf6d7e for how to keep authentication between requests. |
The recommendation you gave for 5bf6d7e works perfect. "your test was not passing on any Symfony version." I pointed to the #6995 because this was the only change that was made after the version I'm using (6c00ffe) that has anything to do with this issue. I'm not sure this change was the cause but is seemed it was. |
What I meant is that the bug might still exist, and so, we probably need to figure it out. |
* 2.2: (22 commits) [Process] Fix regression introduced in #6620 / 880da01, fixes #7082 [HttpKernel] added a unit for the previous commit (closes #7025) [HttpFoundation] fixed, overwritten CONTENT_TYPE [BrowserKit] fixed test added in the previous merge (refs #7059) [FrameworkBundle] tweaked reference dumper command (see #7093) Remove unnecessary comment and change test name [Config] tweaked dumper to indent multi-line info [HttpKernel] added some tests for previous merge Fix REMOTE_ADDR for cached subrequests [FrameworkBundle] CSRF should be on by default [WebProfilerBundle] removed dependency on FrameworkBundle (closes #6949) [HttpKernel] added error display suppression when using the ErrorHandler (if not, errors are displayed twice, refs #6254) [HttpFoundation] tweaked previous merge [HttpFoundation] Added getter for httpMethodParameterOverride state Create validators.lv.xlf [Process] Warn user with a useful message when tmpfile() failed [BrowserKit] added a test to make sure HTTP authentication is preserved when submitting a form Remove array type hint from GetResponseForControllerResultEvent::setControllerResult() bumped Symfony version to 2.2.0-DEV Revert "merged branch povilas/issue_6101 (PR #6708)" ...
* 2.2: (22 commits) [Process] Fix regression introduced in symfony#6620 / 880da01, fixes symfony#7082 [HttpKernel] added a unit for the previous commit (closes symfony#7025) [HttpFoundation] fixed, overwritten CONTENT_TYPE [BrowserKit] fixed test added in the previous merge (refs symfony#7059) [FrameworkBundle] tweaked reference dumper command (see symfony#7093) Remove unnecessary comment and change test name [Config] tweaked dumper to indent multi-line info [HttpKernel] added some tests for previous merge Fix REMOTE_ADDR for cached subrequests [FrameworkBundle] CSRF should be on by default [WebProfilerBundle] removed dependency on FrameworkBundle (closes symfony#6949) [HttpKernel] added error display suppression when using the ErrorHandler (if not, errors are displayed twice, refs symfony#6254) [HttpFoundation] tweaked previous merge [HttpFoundation] Added getter for httpMethodParameterOverride state Create validators.lv.xlf [Process] Warn user with a useful message when tmpfile() failed [BrowserKit] added a test to make sure HTTP authentication is preserved when submitting a form Remove array type hint from GetResponseForControllerResultEvent::setControllerResult() bumped Symfony version to 2.2.0-DEV Revert "merged branch povilas/issue_6101 (PR symfony#6708)" ...
Since #6995 BrowseKit no longer seems to preserve the HTTP authentication when submitting a form. This PR adds a test to demonstrate the failure.