From ecf92ac00f4db40812076d5636c087f222efce40 Mon Sep 17 00:00:00 2001 From: vrana Date: Thu, 21 Jun 2012 13:36:34 -0700 Subject: [PATCH] Support petabytes Test Plan: New test. Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D2821 --- src/view/__tests__/PhabricatorUnitsTestCase.php | 5 +++++ src/view/viewutils.php | 1 + 2 files changed, 6 insertions(+) diff --git a/src/view/__tests__/PhabricatorUnitsTestCase.php b/src/view/__tests__/PhabricatorUnitsTestCase.php index 47e3e60b8e..5615558652 100644 --- a/src/view/__tests__/PhabricatorUnitsTestCase.php +++ b/src/view/__tests__/PhabricatorUnitsTestCase.php @@ -61,6 +61,11 @@ final class PhabricatorUnitsTestCase extends PhabricatorTestCase { phabricator_parse_bytes($input), 'phabricator_parse_bytes('.$input.')'); } + + $this->tryTestCases( + array('string' => 'string'), + array(false), + 'phabricator_parse_bytes'); } public function testDetailedDurationFormatting() { diff --git a/src/view/viewutils.php b/src/view/viewutils.php index b356df230a..c1e63e700b 100644 --- a/src/view/viewutils.php +++ b/src/view/viewutils.php @@ -218,6 +218,7 @@ function phabricator_parse_bytes($input) { 'm' => 1000 * 1000, 'g' => 1000 * 1000 * 1000, 't' => 1000 * 1000 * 1000 * 1000, + 'p' => 1000 * 1000 * 1000 * 1000 * 1000, ); $bytes = (float)$bytes;