[2.2][DomCrawler] Added ability to set file as raw path to file field #5407

Merged
merged 1 commit into from Oct 14, 2012

4 participants

@hason

Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes
License of the code: MIT

For description see #4674 (#4674 (comment))

Related PRs:

Behat/MinkBrowserKitDriver#1
https://github.com/Behat/MinkGoutteDriver/pull/7
FriendsOfPHP/Goutte#77

@travisbot

This pull request passes (merged c3c29e5d into c0673d7).

@fabpot fabpot and 1 other commented on an outdated diff Sep 10, 2012
src/Symfony/Component/DomCrawler/Field/FileFormField.php
@@ -77,6 +67,21 @@ public function setValue($value)
}
/**
+ * Sets the value of the field.
+ *
+ * @param string $value The value of the field
+ * @param Boolean $raw Set file path as string (for simulating HTTP request)
+ */
+ public function setValue($value, $raw = false)
@fabpot
Symfony member
fabpot added a line comment Sep 10, 2012

I don't like the method signature change. I would prefer to add a new method for this use case. It also makes things more explicit.

@hason
hason added a line comment Sep 10, 2012

This proposed change is very elegant, no BC and setValue($foo, true) works with (right behaviour) or without (bad behavior in some cases) this change. But I agree that it's not a nice solution. So should I leave setValue as alias for upload and create setFilePathmethod?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@hason hason referenced this pull request in FriendsOfPHP/Goutte Oct 10, 2012
Merged

Allowed set files for creating HTTP request on client-side #77

@stof
Symfony member

@fabpot anything missing here ?

@fabpot fabpot added a commit that referenced this pull request Oct 14, 2012
@fabpot fabpot merged branch hason/crawler (PR #5407)
This PR was merged into the master branch.

Commits
-------

c902966 [DomCrawler] Added ability to set file as raw path to file field

Discussion
----------

[2.2][DomCrawler] Added ability to set file as raw path to file field

Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes
License of the code: MIT

For description see #4674 (#4674 (comment))

Related PRs:

Behat/MinkBrowserKitDriver#1
https://github.com/Behat/MinkGoutteDriver/pull/7
FriendsOfPHP/Goutte#77

---------------------------------------------------------------------------

by stof at 2012-10-13T21:53:27Z

@fabpot anything missing here ?
0fc0fb3
@fabpot fabpot merged commit c902966 into symfony:master Oct 14, 2012
@mmucklo mmucklo pushed a commit that referenced this pull request May 23, 2013
@fabpot fabpot merged branch hason/crawler (PR #5407)
This PR was merged into the master branch.

Commits
-------

c902966 [DomCrawler] Added ability to set file as raw path to file field

Discussion
----------

[2.2][DomCrawler] Added ability to set file as raw path to file field

Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes
License of the code: MIT

For description see #4674 (#4674 (comment))

Related PRs:

Behat/MinkBrowserKitDriver#1
https://github.com/Behat/MinkGoutteDriver/pull/7
FriendsOfPHP/Goutte#77

---------------------------------------------------------------------------

by stof at 2012-10-13T21:53:27Z

@fabpot anything missing here ?
f18d399
@LagartoSeb LagartoSeb pushed a commit to LagartoSeb/Goutte-test-app that referenced this pull request Jun 7, 2015
@fabpot fabpot merged branch hason/file_client (PR #77)
This PR was merged into the master branch.

Commits
-------

3ae1a8c Fixed regression for a cause if upload failed
c05e1f0 Allowed set files for creating HTTP request on client-side

Discussion
----------

Allowed set files for creating HTTP request on client-side

For description see symfony/symfony#4674 (comment)

Related PRs:

Behat/MinkBrowserKitDriver#1
https://github.com/Behat/MinkGoutteDriver/pull/7
symfony/symfony#5407

---------------------------------------------------------------------------

by hason at 2012-09-06T10:55:52Z

@jhedstrom Fixes also #76. Can you test please?

---------------------------------------------------------------------------

by jhedstrom at 2012-09-06T18:15:27Z

This does indeed fix #76. Thanks!

---------------------------------------------------------------------------

by hason at 2012-09-10T07:49:52Z

@fabpot This PR works with/without symfony/symfony#5407 (no BC).

---------------------------------------------------------------------------

by hason at 2012-10-10T09:26:00Z

@fabpot Please, can you merge this PR?
4c192d5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment