Skip to content

[REST] Break on file upload #3298

Closed
Closed

Description

@VincentClair

Hello,

Before, with version 2.1.8, we could pass a Symfony\Component\HttpFoundation\File\UploadedFile as value . Something like:

$I->sendPOST('/ui/options/images',
    ['name'  => 'logo'],
    ['image' => new UploadedFile($filePath, $filename, $mimeType, filesize($filePath))]
);

Since version 2.2.2, it seems to be broken. I get an error that the value of key image is invalid.
I changed the UploadedFile to the indexed array version and it works.
Is it normal ?

Activity

  1. DavertMik commented on Jun 30, 2016

    @DavertMik
    Member

    I never knew Symfony\Component\HttpFoundation\File\UploadedFile can be passed, he-he )
    It class is not even part of Codeception package so this behavior was not expected.
    But if @Naktibalda will provide a way to do this that would be useful too. Probably we will need to update docs to specify such behavior

  2. Naktibalda commented on Jun 30, 2016

    @Naktibalda
    Member

    Anything that's expected by a framework could be passed.
    We really need to document file uploads.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions