WordPress.org

Make WordPress Core

Changeset 1270 in tests


Ignore:
Timestamp:
04/23/13 01:12:48 (12 months ago)
Author:
SergeyBiryukov
Message:

Fix wp_convert_bytes_to_hr() test for decimal comma locales. see #23626.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/media.php

    r1263 r1270  
    165165 
    166166        // now some values around 
    167         $this->assertTrue( abs( 1.50000095367 - (float) wp_convert_bytes_to_hr( $tb + $tb / 2 + $mb ) ) < 0.0001 ); 
    168         $this->assertTrue( abs( 1023.99902248 - (float) wp_convert_bytes_to_hr( $tb - $mb - $kb ) ) < 0.0001 ); 
    169         $this->assertTrue( abs( 1.5009765625 - (float) wp_convert_bytes_to_hr( $gb + $gb / 2 + $mb ) ) < 0.0001 ); 
    170         $this->assertTrue( abs( 1022.99902344 - (float) wp_convert_bytes_to_hr( $gb - $mb - $kb ) ) < 0.0001 ); 
     167        $hr = wp_convert_bytes_to_hr( $tb + $tb / 2 + $mb ); 
     168        $this->assertTrue( abs( 1.50000095367 - (float) str_replace( ',', '.', $hr ) ) < 0.0001 ); 
     169 
     170        $hr = wp_convert_bytes_to_hr( $tb - $mb - $kb ); 
     171        $this->assertTrue( abs( 1023.99902248 - (float) str_replace( ',', '.', $hr ) ) < 0.0001 ); 
     172 
     173        $hr = wp_convert_bytes_to_hr( $gb + $gb / 2 + $mb ); 
     174        $this->assertTrue( abs( 1.5009765625 - (float) str_replace( ',', '.', $hr ) ) < 0.0001 ); 
     175 
     176        $hr = wp_convert_bytes_to_hr( $gb - $mb - $kb ); 
     177        $this->assertTrue( abs( 1022.99902344 - (float) str_replace( ',', '.', $hr ) ) < 0.0001 ); 
    171178 
    172179        // edge 
Note: See TracChangeset for help on using the changeset viewer.