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
[ticket/11192] Add Tebibyte to get_formatted_filesize(). #1074
Conversation
wat |
Was this tested on 32 bit php? Regression test please. |
PHPBB3-11192
*/ | ||
public function test_get_formatted_filesize_string($input, $expected) | ||
{ | ||
$output = get_formatted_filesize("$input"); |
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.
$input is already a string?
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.
fixed
{ | ||
return array( | ||
// exact powers of 2 | ||
array(1, '1 BYTES'), |
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.
BYTES should be singular, same thing below.
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.
unrelated? there is no such language variable right now. maybe the function should use $user->lang()
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.
It does, if $user is set up, which for this test it isn't.
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.
It doesn't call the lang function, it does an array lookup.
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.
OK, it's fine with me either way, do you want to change anything?
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.
Not in this PR.
… now. PHPBB3-11192
* bantu/ticket/11192: [ticket/11192] Merge dataProvider arrays because the test is the same now. [ticket/11192] Update $value parameter description to support other types. [ticket/11192] Mark negative byte numbers as unsupported. [ticket/11192] Test strings not converted to int/float before. [ticket/11192] Also test strings, e.g. sums returned by the database. [ticket/11192] Also test powers of 10 / 1000. [ticket/11192] Add tests. [ticket/11192] Add Tebibyte to get_formatted_filesize().
* develop-olympus: [ticket/11192] Merge dataProvider arrays because the test is the same now. [ticket/11192] Update $value parameter description to support other types. [ticket/11192] Mark negative byte numbers as unsupported. [ticket/11192] Test strings not converted to int/float before. [ticket/11192] Also test strings, e.g. sums returned by the database. [ticket/11192] Also test powers of 10 / 1000. [ticket/11192] Add tests. [ticket/11192] Add Tebibyte to get_formatted_filesize().
PHPBB3-11192
http://tracker.phpbb.com/browse/PHPBB3-11192