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

[ticket/11192] Add Tebibyte to get_formatted_filesize(). #1074

Merged
merged 8 commits into from Nov 16, 2012

Conversation

bantu
Copy link
Collaborator

@bantu bantu commented Nov 11, 2012

@callumacrae
Copy link
Contributor

wat

@p
Copy link
Contributor

p commented Nov 12, 2012

Was this tested on 32 bit php? Regression test please.

@p
Copy link
Contributor

p commented Nov 16, 2012

p@c15b989

*/
public function test_get_formatted_filesize_string($input, $expected)
{
$output = get_formatted_filesize("$input");
Copy link
Contributor

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?

Copy link
Collaborator Author

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'),
Copy link
Contributor

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.

Copy link
Collaborator Author

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()

Copy link
Contributor

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.

Copy link
Collaborator Author

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.

Copy link
Contributor

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?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not in this PR.

p added a commit to p/phpbb3 that referenced this pull request Nov 16, 2012
* 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().
p added a commit to p/phpbb3 that referenced this pull request Nov 16, 2012
* 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().
@p p merged commit 8851f95 into phpbb:develop-olympus Nov 16, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants