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

Filesystem::remove() argument #1 must be string, SplFileInfo given #908

Open
Nurgiel opened this issue Oct 11, 2023 · 8 comments
Open

Filesystem::remove() argument #1 must be string, SplFileInfo given #908

Nurgiel opened this issue Oct 11, 2023 · 8 comments
Assignees

Comments

@Nurgiel
Copy link

Nurgiel commented Oct 11, 2023

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
@m2-assistant
Copy link

m2-assistant bot commented Oct 11, 2023

Hi @Nurgiel. Thank you for your report.
To speed up processing of this issue, make sure that you provided sufficient information.
Add a comment to assign the issue: @magento I am working on this


Join Magento Community Engineering Slack and ask your questions in #github channel.

@Nurgiel
Copy link
Author

Nurgiel commented Oct 11, 2023

@magento I am working on this

@m2-assistant
Copy link

m2-assistant bot commented Oct 11, 2023

Hi @Nurgiel! 👋
Thank you for collaboration. Only members of Community Contributors Team are allowed to be assigned to the issue. Please use @magento add to contributors team command to join Contributors team.

@Nurgiel
Copy link
Author

Nurgiel commented Oct 11, 2023

@magento add to contributors team

@m2-assistant
Copy link

m2-assistant bot commented Oct 11, 2023

Hi @Nurgiel! 👋
Thank you for joining. Please accept team invitation 👉 here 👈 and add your comment one more time.

@Nurgiel
Copy link
Author

Nurgiel commented Oct 11, 2023

@magento I am working on this

@Nurgiel
Copy link
Author

Nurgiel commented Oct 12, 2023

I got the same issue running MFTF in Magento Docker with docker-compose run test mftf-command build:project

@snez
Copy link

snez commented Oct 27, 2023

I had the same problem, solved it by manually deleting a previously generated test suite file before re-running build:project. The file was located under:

vendor/magento/magento2-functional-testing-framework//src/Magento/FunctionalTestingFramework/Group/

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

No branches or pull requests

2 participants