Skip to content

[Form] Error when uploading an image in functional tests #11110

@OwlyCode

Description

@OwlyCode

I have a functional test that does this :

$form = $crawler->selectButton('Submit the form')->form(array(
    'project[title]' => 'Foo',
    'project[summary]' => 'Bar'
));
$form['project[pictureFile]']->upload('some/file.png');
$this->client->submit($form);

It used to work on 2.4 but no more on 2.5 :

Cannot access  property Symfony\Component\Validator\Constraints\ImageValidator::$suffices in Symfony/Component/Validator/Constraints/FileValidator.php on line 163

The problem is introduced by e4c6da5. I guess it's because we use static::$attribute from an inherited class on a private property in FileValidator.php:163.

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