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

Feature request: \Codeception\Module\Filesystem::writeToFile create a directory recursively. #3

Open
Luc45 opened this issue Oct 2, 2020 · 0 comments

Comments

@Luc45
Copy link

Luc45 commented Oct 2, 2020

Scenario:

I want to create a file inside a folder:
$I->writeToFile('/var/www/foo/foo.php', '');

This will fail because the folder foo does not exist.

Now I have to create the folder recursively and keep track of it for deletion.

    public function writeToFile($filename, $contents)
    {
        file_put_contents($filename, $contents);
    }

This issue is a feature request to make that method more robust, using perhaps Symfony Filesystem to recursively create the directory. Eg: https://symfony.com/doc/current/components/filesystem.html#mkdir

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

1 participant