-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[FileValidator] Format file size in validation message according to binaryFormat option #27970
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
[FileValidator] Format file size in validation message according to binaryFormat option #27970
Conversation
I'm not very proud of how i changed the tests, i think i used a dirty trick. |
f48001d
to
e34d9a3
Compare
@@ -57,6 +57,16 @@ protected function tearDown() | |||
$this->file = null; | |||
} | |||
|
|||
// Allows the invocation of a private method | |||
public function invokeMethod($object, $methodName, $params = array()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's do this inline, no need for a method when it is used only once here
e34d9a3
to
8c7c023
Compare
8c7c023
to
45e5084
Compare
45e5084
to
0edbbd3
Compare
Thank you @jfredon. |
…ording to binaryFormat option (jfredon) This PR was merged into the 2.8 branch. Discussion ---------- [FileValidator] Format file size in validation message according to binaryFormat option | Q | A | ------------- | --- | Branch? | 2.8 up to master | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #27682 | License | MIT | Doc PR | The binaryFormat option of the constraint is not taken into account if the maxsize limit is defined by the php configuration files. This patch correct this inconsistent behavior. If the binaryOption is not set, the unit of measurement used remains in binary because it’s the unit used in php configuration files. Commits ------- 0edbbd3 Format file size in validation message according to binaryFormat option
The binaryFormat option of the constraint is not taken into account if the maxsize limit is defined by the php configuration files.
This patch correct this inconsistent behavior.
If the binaryOption is not set, the unit of measurement used remains in binary because it’s the unit used in php configuration files.