Level 3
I believe all that gets destroyed in the parent teardown, so try moving your delete to before parent::teardown()?
3 likes
Summer Sale! All accounts are 50% off this week.
My laravel app can create a folder.
In a feature test I call the endpoint. The app creates a folder with data.
I want to delete the folder after test.
I created tearDown() method
protected function tearDown() {
parent::tearDown();
\File::deleteDirectory(public_path($this->folder));
}
And I receive an error
Class path.public does not exist
If I pass a real path
\File::deleteDirectory('D:\path\to\the\folder');
It deletes the folder but I still receive another error
Class files does not exist
But both of them work fine in a test method. What's wrong with tearDown()? (or with me?)
I believe all that gets destroyed in the parent teardown, so try moving your delete to before parent::teardown()?
Please or to participate in this conversation.