Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[908] fix filesystem remove file #909

Closed

Conversation

Nurgiel
Copy link

@Nurgiel Nurgiel commented Oct 11, 2023

#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

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/verification tests (if applicable)
  • All automated tests passed successfully (all builds are green)
  • Changes to Framework doesn't have backward incompatible changes for tests or have related Pull Request with fixes to tests

@Nurgiel Nurgiel closed this Mar 21, 2024
@Nurgiel Nurgiel deleted the 908-fix-filesystem-remove-file branch March 21, 2024 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant