magento / magento2-functional-testing-framework

Magento2 Functional Testing Framework
Other
155 stars 133 forks source link

[908] fix filesystem remove file #909

Closed Nurgiel closed 5 months ago

Nurgiel commented 10 months ago

https://github.com/magento/magento2-functional-testing-framework/issues/908

Hello, I'm getting an error when running vendor/bin/mftf build:project

I also managed to fix it my changing line 89 in vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Console/CleanProjectCommand.php from: $fileSystem->remove($file); to $fileSystem->remove($file->getRealPath());

Preconditions

  1. PHP 8.1.23
  2. Chrome Browser Version: 117.0.5938.132
  3. ChromeDriver Version: 117.0.5938.149
  4. composer.json
    "name": "magento/magento-cloud-template",
    "version": "2.4.6",
    (...)
    "require-dev": {
        "allure-framework/allure-phpunit": "*",
        "codeception/module-asserts": "*",
        "codeception/module-phpbrowser": "*",
        "magento/magento2-functional-testing-framework": "*",
        "phpunit/phpunit": "*"
    }

Steps to reproduce

  1. vendor/bin/mftf build:project

Expected result

  1. no error

Actual result

PHP Fatal error:  Uncaught TypeError: Symfony\Component\Filesystem\Filesystem::remove(): Argument #1 ($files) must be of type iterable|string, Symfony\Component\Finder\SplFileInfo given, called in /var/www/html/project-name/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Console/CleanProjectCommand.php on line 89 and defined in /var/www/html/project-name/vendor/symfony/filesystem/Filesystem.php:150

Fixed Issues (if relevant)

  1. Argument passed to Filesystem:remove() is now a string instead of SplFileInfo object.

Contribution checklist