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/db/charset.php

    r37320 r38382  
    544544
    545545        $vars = array();
    546         foreach( $this->table_and_column_defs as $value ) {
    547             $this_table_name = $table_name . '_' . rand_str( 5 );
     546        foreach( $this->table_and_column_defs as $i => $value ) {
     547            $this_table_name = $table_name . '_' . $i;
    548548            $drop = "DROP TABLE IF EXISTS $this_table_name";
    549549            $create = "CREATE TABLE $this_table_name {$value['definition']}";
     
    584584
    585585        $vars = array();
    586         foreach( $this->table_and_column_defs as $value ) {
    587             $this_table_name = $table_name . '_' . rand_str( 5 );
     586        foreach( $this->table_and_column_defs as $i => $value ) {
     587            $this_table_name = $table_name . '_' . $i;
    588588            $drop = "DROP TABLE IF EXISTS $this_table_name";
    589589            $create = "CREATE TABLE $this_table_name {$value['definition']}";
     
    688688        );
    689689
    690         foreach( $data as &$value ) {
    691             $this_table_name = $table_name . '_' . rand_str( 5 );
     690        foreach( $data as $i => &$value ) {
     691            $this_table_name = $table_name . '_' . $i;
    692692
    693693            $value[0] = "CREATE TABLE $this_table_name {$value[0]}";
     
    802802        );
    803803
    804         foreach( $data as &$value ) {
    805             $this_table_name = $table_name . '_' . rand_str( 5 );
     804        foreach( $data as $i => &$value ) {
     805            $this_table_name = $table_name . '_' . $i;
    806806
    807807            $value[0] = "CREATE TABLE $this_table_name {$value[0]}";
Note: See TracChangeset for help on using the changeset viewer.