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

Make PSR7 uploaded files accessible in integration tests #12833

Merged
merged 3 commits into from Dec 27, 2018

Conversation

robertpustulka
Copy link
Member

This fix makes it possible to test controller actions that expect uploads are accessible from getUploadedFiles().

Unfortunately files passed as POST data body are not present in getUploadedFiles() and to test those properly $_FILES had to be injected with files directly.

@codecov
Copy link

codecov bot commented Dec 21, 2018

Codecov Report

Merging #12833 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #12833      +/-   ##
============================================
+ Coverage     90.42%   90.42%   +<.01%     
  Complexity    14043    14043              
============================================
  Files           522      522              
  Lines         36121    36122       +1     
============================================
+ Hits          32663    32664       +1     
  Misses         3458     3458
Impacted Files Coverage Δ Complexity Δ
src/TestSuite/IntegrationTestTrait.php 98.63% <100%> (ø) 105 <0> (ø) ⬇️
src/TestSuite/MiddlewareDispatcher.php 92.85% <100%> (+0.12%) 16 <0> (ø) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0be30d0...0ec1bc9. Read the comment docs.

['file' => 2010]
],
],
'upload' => new UploadedFile(__FILE__, 42, 0)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like something that should be possible. Is making this work complicated?

@markstory markstory merged commit 203fe98 into cakephp:master Dec 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants