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

[8.x] Adds the possibility of testing file upload content #35231

Merged
merged 1 commit into from Nov 16, 2020

Conversation

nunomaduro
Copy link
Member

@nunomaduro nunomaduro commented Nov 15, 2020

This pull request adds the possibility of testing the file upload content while checking if the file exist:

Before:

Storage::disk('reports')->assertExists('foo.csv');
$this->assertSame('my;csv;content', Storage::disk('reports')->read('foo.csv'));

After:

Storage::disk('reports')->assertExists('foo.csv', 'my;csv;content');

* @return $this
*/
public function assertExists($path)
public function assertExists($path, $content = null)
Copy link
Member

@driesvints driesvints Nov 16, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a breaking change unfortunately :-/

Copy link
Member Author

@nunomaduro nunomaduro Nov 16, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed - but I think this may be a breaking change that doesn't "really" affect people.

Reasoning: This method seems to be used only in testing, and people would have to extend this class, and this method, for this to affect their test suites.

What do you think @driesvints ?

Copy link
Member

@driesvints driesvints Nov 16, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I personally feel like we should avoid all breaking changes. Every one is a risk we take. But let's let @taylorotwell decide.

@taylorotwell taylorotwell merged commit 5f1e118 into 8.x Nov 16, 2020
26 checks passed
@taylorotwell taylorotwell deleted the feat/assert-exist-with-content-to-filesystem branch Nov 16, 2020
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.

None yet

3 participants