Skip to content

Bug in PHPUnit test (null should be array) #3533

Closed
@syno-dlr

Description

@syno-dlr

Hello all,

I just launched the standard PHPUnit test (without the dev:tests:run command) :

php <magentodir>/vendor/phpunit/phpunit/phpunit --debug

I am in <magentodir>/dev/tests/unit directory.

There is a fatal error on Magento\DownloadableImportExport\Model\Import\Product\Type\Downloadable file. On function fillDataLink, there is a fillExistOptions call where $existingOptions is null. It should be an array. It's the same in fillDataTitleLink method.

I just add an ugly fix with a is_null check for $existingOptions and set it to an empty array and it works.

I think the best way should be to change the fetchAll method to always return an empty array, if no data is retrieved in database.

Is there something I did wrong ?

Damien.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions