Make WordPress Core


Ignore:
Timestamp:
10/09/2016 01:11:14 AM (9 years ago)
Author:
johnbillion
Message:

Build/Test Tools: Begin eliminating unnecessary randomness in tests.

Although unlikely, clashes in randomly generated strings could cause unexpected failures. In addition, most randomness is entirely unnecessary, is bad practice, and increases test time (however small it may be).

See #37371

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/multisite/getSpaceUsed.php

    r35242 r38762  
    3636
    3737        // Upload a file to the new site.
    38         $filename = rand_str().'.jpg';
    39         $contents = rand_str();
     38        $filename = __FUNCTION__ . '.jpg';
     39        $contents = __FUNCTION__ . '_contents';
    4040        $file = wp_upload_bits( $filename, null, $contents );
    4141
     
    7272
    7373        // Upload a file to the new site.
    74         $filename = rand_str().'.jpg';
    75         $contents = rand_str();
     74        $filename = __FUNCTION__ . '.jpg';
     75        $contents = __FUNCTION__ . '_contents';
    7676        wp_upload_bits( $filename, null, $contents );
    7777
Note: See TracChangeset for help on using the changeset viewer.