Changeset 52955 for trunk/tests/phpunit/tests/functions/sizeFormat.php
- Timestamp:
- 03/18/2022 08:46:17 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/functions/sizeFormat.php
r49006 r52955 4 4 * Tests for size_format() 5 5 * 6 * @ticket 22405 6 7 * @ticket 36635 8 * @ticket 40875 7 9 * 8 10 * @group functions.php … … 13 15 public function _data_size_format() { 14 16 return array( 17 // Invalid values 15 18 array( array(), 0, false ), 16 19 array( 'baba', 0, false ), … … 18 21 array( '-1', 0, false ), 19 22 array( -1, 0, false ), 23 // Bytes 20 24 array( 0, 0, '0 B' ), 21 25 array( 1, 0, '1 B' ), 22 26 array( 1023, 0, '1,023 B' ), 27 // Kilobytes 23 28 array( KB_IN_BYTES, 0, '1 KB' ), 24 29 array( KB_IN_BYTES, 2, '1.00 KB' ), … … 26 31 array( 2.5 * KB_IN_BYTES, 2, '2.50 KB' ), 27 32 array( 10 * KB_IN_BYTES, 0, '10 KB' ), 33 // Megabytes 28 34 array( (string) 1024 * KB_IN_BYTES, 2, '1.00 MB' ), 29 35 array( MB_IN_BYTES, 0, '1 MB' ), 30 36 array( 2.5 * MB_IN_BYTES, 0, '3 MB' ), 31 37 array( 2.5 * MB_IN_BYTES, 2, '2.50 MB' ), 38 // Gigabytes 32 39 array( (string) 1024 * MB_IN_BYTES, 2, '1.00 GB' ), 33 40 array( GB_IN_BYTES, 0, '1 GB' ), 34 41 array( 2.5 * GB_IN_BYTES, 0, '3 GB' ), 35 42 array( 2.5 * GB_IN_BYTES, 2, '2.50 GB' ), 43 // Terabytes 36 44 array( (string) 1024 * GB_IN_BYTES, 2, '1.00 TB' ), 37 45 array( TB_IN_BYTES, 0, '1 TB' ), 38 46 array( 2.5 * TB_IN_BYTES, 0, '3 TB' ), 39 47 array( 2.5 * TB_IN_BYTES, 2, '2.50 TB' ), 48 // Petabytes 49 array( (string) 1024 * TB_IN_BYTES, 2, '1.00 PB' ), 50 array( PB_IN_BYTES, 0, '1 PB' ), 51 array( 2.5 * PB_IN_BYTES, 0, '3 PB' ), 52 array( 2.5 * PB_IN_BYTES, 2, '2.50 PB' ), 53 // Exabytes 54 array( (string) 1024 * PB_IN_BYTES, 2, '1.00 EB' ), 55 array( EB_IN_BYTES, 0, '1 EB' ), 56 array( 2.5 * EB_IN_BYTES, 0, '3 EB' ), 57 array( 2.5 * EB_IN_BYTES, 2, '2.50 EB' ), 58 // Zettabytes 59 array( (string) 1024 * EB_IN_BYTES, 2, '1.00 ZB' ), 60 array( ZB_IN_BYTES, 0, '1 ZB' ), 61 array( 2.5 * ZB_IN_BYTES, 0, '3 ZB' ), 62 array( 2.5 * ZB_IN_BYTES, 2, '2.50 ZB' ), 63 // Yottabytes 64 array( (string) 1024 * ZB_IN_BYTES, 2, '1.00 YB' ), 65 array( YB_IN_BYTES, 0, '1 YB' ), 66 array( 2.5 * YB_IN_BYTES, 0, '3 YB' ), 67 array( 2.5 * YB_IN_BYTES, 2, '2.50 YB' ), 68 // Edge values 40 69 array( TB_IN_BYTES + ( TB_IN_BYTES / 2 ) + MB_IN_BYTES, 1, '1.5 TB' ), 41 70 array( TB_IN_BYTES - MB_IN_BYTES - KB_IN_BYTES, 3, '1,023.999 GB' ),
Note: See TracChangeset
for help on using the changeset viewer.