Skip to content
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

[2.0.x] Readded Http\Request::hasPut() (#10283) #10289

Merged
merged 3 commits into from
May 12, 2015
Merged

[2.0.x] Readded Http\Request::hasPut() (#10283) #10289

merged 3 commits into from
May 12, 2015

Conversation

SidRoberts
Copy link
Contributor

@Green-Cat
Copy link
Contributor

👍

@sergeyklay
Copy link
Contributor

@SidRoberts
Copy link
Contributor Author

@sergeyklay I've tried to write tests but as PUT data is taken from php://input, I can't think of a feasible way to test it. On the plus side, attempting to write tests made me realise $_PUT doesn't exist. 😛

@sergeyklay
Copy link
Contributor

Another plus of testing

@andresgutierrez
Copy link
Contributor

The contents of file_get_contents("php://input") must be cached in a property, because if you call it twice the second will return null

@sergeyklay
Copy link
Contributor

Why not use define('PHP_INPUT', 'php://input') or something like that at start (bootstrap) time? :)

@andresgutierrez
Copy link
Contributor

Could you please update the CHANGELOG?

@SidRoberts
Copy link
Contributor Author

@andresgutierrez Done.

andresgutierrez added a commit that referenced this pull request May 12, 2015
[2.0.x] Readded Http\Request::hasPut() (#10283)
@andresgutierrez andresgutierrez merged commit d6997e2 into phalcon:2.0.x May 12, 2015
@andresgutierrez
Copy link
Contributor

Thanks

@SidRoberts SidRoberts deleted the fix-10283 branch May 12, 2015 11:57
@sergeyklay
Copy link
Contributor

@SidRoberts

I can't think of a feasible way to test it.

stream_wrapper_unregister("php");
stream_wrapper_register("php", "your_awesome_stream_mock_class");
// ...
// tests
// ...
stream_wrapper_restore("php");

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants