Make WordPress Core


Ignore:
Timestamp:
08/26/2016 08:21:30 PM (8 years ago)
Author:
johnbillion
Message:

Build/Test Tools: Remove many unnecessary calls to rand_str() which can, in theory, fail at random. Static strings are much more appropriate.

See #37371

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/user.php

    r38278 r38382  
    104104    // simple tests for usermeta functions
    105105    function test_usermeta() {
    106         $key = rand_str();
    107         $val = rand_str();
     106        $key = 'key';
     107        $val = 'value1';
    108108
    109109        // get a meta key that doesn't exist
     
    115115
    116116        // change and get again
    117         $val2 = rand_str();
     117        $val2 = 'value2';
    118118        update_user_meta( self::$author_id, $key, $val2 );
    119119        $this->assertEquals( $val2, get_user_meta( self::$author_id, $key, true ) );
     
    582582    function test_user_update_email_error() {
    583583        $id1 = wp_insert_user( array(
    584             'user_login' => rand_str(),
     584            'user_login' => 'blackburn',
    585585            'user_pass'  => 'password',
    586586            'user_email' => 'blackburn@battlefield4.com',
     
    589589
    590590        $id2 = wp_insert_user( array(
    591             'user_login' => rand_str(),
     591            'user_login' => 'miller',
    592592            'user_pass'  => 'password',
    593593            'user_email' => 'miller@battlefield4.com',
Note: See TracChangeset for help on using the changeset viewer.