Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fixes #9 Bridge error when no file is selected #23

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

Merged
merged 3 commits into from
Aug 18, 2016

Conversation

Danielss89
Copy link

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #9
License MIT
Doc PR

$temporaryPath = $this->getTemporaryPath();
$psrUploadedFile->moveTo($temporaryPath);
$temporaryPath = '';
$clientFileName = null;
Copy link

@Tobion Tobion Jun 2, 2016

Choose a reason for hiding this comment

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

you could set this to ''. below there is a check against null which only needs to trigger if $psrUploadedFile->getClientFilename() returns null.

@Tobion
Copy link

Tobion commented Jun 2, 2016

Please squash commits per author (1 commit per author).

$file = new UploadedFile('', '', null, 0, UPLOAD_ERR_NO_FILE, true);
$this->assertEquals(0, $file->getSize());
$this->assertEquals(UPLOAD_ERR_NO_FILE, $file->getError());
$this->assertFalse($file->getSize());
Copy link
Member

Choose a reason for hiding this comment

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

There should be a third argument like this:

$this->assertFalse($file->getSize(), 'SplFile::getSize() returns false on error');

Copy link

Choose a reason for hiding this comment

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

Don't you mean a second argument to assertFalse? It would be a third argument for assertEquals, but the comment you linked to erroneously mentioned assertFalse.

Assert false doesn't take a third argument.

@weaverryan
Copy link
Member

It looks like all the comments from #10 have been addressed here. Does anyone else have any issues, or can we merge this?

@fabpot
Copy link
Member

fabpot commented Aug 18, 2016

Thank you @Danielss89.

@fabpot fabpot merged commit a1a631a into symfony:master Aug 18, 2016
fabpot added a commit that referenced this pull request Aug 18, 2016
…ielss89)

This PR was merged into the master branch.

Discussion
----------

Fixes #9 Bridge error when no file is selected

Q	A
Bug fix?	yes
New feature?	no
BC breaks?	no
Deprecations?	no
Tests pass?	yes
Fixed tickets	#9
License	MIT
Doc PR

Commits
-------

a1a631a Update assert error message
e5d62e6 Fixes based on code-review
101b608 Handles null file in createrequest bridge.
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.

7 participants