[ColdBox 5.6.2][Testbox] - How do I test file uploads?

Skip to first unread message

Ryan Stille

Nov 20, 2020, 12:10:56 PM11/20/20
to ColdBox Platform
Hi, is it possible to "fake" a file upload in a test? I want to test a ColdBox handler that processes an uploaded file. It does a <cffile action="upload"> directly in the handler. I know one option is to refactor the code under test to optionally receive a file via argument instead of expecting it to be uploaded from a browser. But I wondered if there was a way for testbox to fake the file upload? I think this would be a neat feature.

Maybe the "execute" method in baseTestCase.cfc could accept a path to a file to mock up as a file upload.
Reply all
Reply to author
0 new messages