Make WordPress Core

Changeset 52389


Ignore:
Timestamp:
12/19/2021 01:42:37 PM (5 years ago)
Author:
johnbillion
Message:

Build/Test Tools: Reduce the use of unnecessary randomness in tests.

This increases the overall reliability of the tests.

Props johnillo

Fixes #37371

Location:
trunk/tests/phpunit/tests
Files:
46 edited

Legend:

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

    r52010 r52389  
    241241                $this->assertSame( 0, did_action( $tag2 ) );
    242242
    243                 // Do action $tag2 a random number of times.
    244                 $count = rand( 0, 10 );
     243                // Do action $tag2 10 times.
     244                $count = 10;
    245245                for ( $i = 0; $i < $count; $i++ ) {
    246246                        do_action( $tag2 );
  • trunk/tests/phpunit/tests/admin/includesPlugin.php

    r52010 r52389  
    488488
    489489                $dropins = get_dropins();
    490                 $this->assertSame( array( 'advanced-cache.php' ), array_keys( $dropins ) );
    491490
    492491                unlink( $p1[1] );
    493492                unlink( $p2[1] );
    494493
     494                $this->assertSame( array( 'advanced-cache.php' ), array_keys( $dropins ) );
     495
    495496                // Clean up.
    496497                $this->_restore_drop_ins();
     
    510511                $p = $this->_create_plugin( "<?php\n/*\nPlugin Name: test\nNetwork: true" );
    511512
    512                 $this->assertTrue( is_network_only_plugin( $p[0] ) );
     513                $network_only = is_network_only_plugin( $p[0] );
    513514
    514515                unlink( $p[1] );
     516
     517                $this->assertTrue( $network_only );
    515518        }
    516519
     
    572575                update_option( 'uninstall_plugins', $uninstallable_plugins );
    573576
    574                 $this->assertTrue( is_uninstallable_plugin( $plugin[0] ) );
     577                $is_uninstallable = is_uninstallable_plugin( $plugin[0] );
    575578
    576579                unset( $uninstallable_plugins[ $plugin[0] ] );
     
    578581
    579582                unlink( $plugin[1] );
     583
     584                $this->assertTrue( $is_uninstallable );
    580585        }
    581586
     
    596601        private function _create_plugin( $data = "<?php\n/*\nPlugin Name: Test\n*/", $filename = false, $dir_path = false ) {
    597602                if ( false === $filename ) {
    598                         $filename = rand_str() . '.php';
     603                        $filename = __FUNCTION__ . '.php';
    599604                }
    600605
     
    603608                }
    604609
    605                 $full_name = $dir_path . '/' . wp_unique_filename( $dir_path, $filename );
     610                $filename  = wp_unique_filename( $dir_path, $filename );
     611                $full_name = $dir_path . '/' . $filename;
    606612
    607613                $file = fopen( $full_name, 'w' );
  • trunk/tests/phpunit/tests/cron.php

    r52010 r52389  
    271271        public function test_unschedule_hook() {
    272272                $hook = __FUNCTION__;
    273                 $args = array( rand_str() );
     273                $args = array( 'foo' );
    274274
    275275                // Schedule several events with and without arguments.
  • trunk/tests/phpunit/tests/date/xmlrpc.php

    r52010 r52389  
    229229                        'comment_author_url'   => 'http://example.com/',
    230230                        'comment_author_email' => 'example@example.com',
    231                         'comment_content'      => rand_str( 100 ),
     231                        'comment_content'      => 'Hello, world!',
    232232                        'comment_approved'     => '1',
    233233                );
  • trunk/tests/phpunit/tests/file.php

    r52010 r52389  
    9797                }
    9898
    99                 // Write some random contents.
    100                 $c = rand_str();
     99                // Write some contents.
     100                $c = 'foo';
    101101                fwrite( $fp, $c );
    102102                fclose( $fp );
  • trunk/tests/phpunit/tests/hooks/addFilter.php

    r50342 r52389  
    1616                $hook          = new WP_Hook();
    1717                $tag           = __FUNCTION__;
    18                 $priority      = rand( 1, 100 );
    19                 $accepted_args = rand( 1, 100 );
     18                $priority      = 1;
     19                $accepted_args = 2;
    2020
    2121                $hook->add_filter( $tag, $callback, $priority, $accepted_args );
     
    3131                $hook          = new WP_Hook();
    3232                $tag           = __FUNCTION__;
    33                 $priority      = rand( 1, 100 );
    34                 $accepted_args = rand( 1, 100 );
     33                $priority      = 1;
     34                $accepted_args = 2;
    3535
    3636                $hook->add_filter( $tag, $callback, $priority, $accepted_args );
     
    4545                $hook          = new WP_Hook();
    4646                $tag           = __FUNCTION__;
    47                 $priority      = rand( 1, 100 );
    48                 $accepted_args = rand( 1, 100 );
     47                $priority      = 1;
     48                $accepted_args = 2;
    4949
    5050                $hook->add_filter( $tag, $callback, $priority, $accepted_args );
     
    6060                $hook          = new WP_Hook();
    6161                $tag           = __FUNCTION__;
    62                 $priority      = rand( 1, 100 );
    63                 $accepted_args = rand( 1, 100 );
     62                $priority      = 1;
     63                $accepted_args = 2;
    6464
    6565                $hook->add_filter( $tag, $callback_one, $priority, $accepted_args );
     
    7575                $hook          = new WP_Hook();
    7676                $tag           = __FUNCTION__;
    77                 $priority      = rand( 1, 100 );
    78                 $accepted_args = rand( 1, 100 );
     77                $priority      = 1;
     78                $accepted_args = 2;
    7979
    8080                $hook->add_filter( $tag, $callback_one, $priority, $accepted_args );
     
    9090                $hook          = new WP_Hook();
    9191                $tag           = __FUNCTION__;
    92                 $priority      = rand( 1, 100 );
    93                 $accepted_args = rand( 1, 100 );
     92                $priority      = 1;
     93                $accepted_args = 2;
    9494
    9595                $hook->add_filter( $tag, $callback, $priority, $accepted_args );
     
    104104                $hook          = new WP_Hook();
    105105                $tag           = __FUNCTION__;
    106                 $priority      = rand( 1, 100 );
    107                 $accepted_args = rand( 1, 100 );
     106                $priority      = 1;
     107                $accepted_args = 2;
    108108
    109109                $hook->add_filter( $tag, $callback, $priority, $accepted_args );
  • trunk/tests/phpunit/tests/hooks/applyFilters.php

    r50342 r52389  
    1414                $hook          = new WP_Hook();
    1515                $tag           = __FUNCTION__;
    16                 $priority      = rand( 1, 100 );
    17                 $accepted_args = rand( 1, 100 );
     16                $priority      = 1;
     17                $accepted_args = 2;
    1818                $arg           = __FUNCTION__ . '_arg';
    1919
     
    3131                $hook          = new WP_Hook();
    3232                $tag           = __FUNCTION__;
    33                 $priority      = rand( 1, 100 );
    34                 $accepted_args = rand( 1, 100 );
     33                $priority      = 1;
     34                $accepted_args = 2;
    3535                $arg           = __FUNCTION__ . '_arg';
    3636
  • trunk/tests/phpunit/tests/hooks/doAction.php

    r51568 r52389  
    2222                $hook          = new WP_Hook();
    2323                $tag           = __FUNCTION__;
    24                 $priority      = rand( 1, 100 );
    25                 $accepted_args = rand( 1, 100 );
     24                $priority      = 1;
     25                $accepted_args = 2;
    2626                $arg           = __FUNCTION__ . '_arg';
    2727
     
    3737                $hook          = new WP_Hook();
    3838                $tag           = __FUNCTION__;
    39                 $priority      = rand( 1, 100 );
    40                 $accepted_args = rand( 1, 100 );
     39                $priority      = 1;
     40                $accepted_args = 2;
    4141                $arg           = __FUNCTION__ . '_arg';
    4242
     
    5555                $hook          = new WP_Hook();
    5656                $tag           = __FUNCTION__;
    57                 $priority      = rand( 1, 100 );
    58                 $accepted_args = rand( 1, 100 );
     57                $priority      = 1;
     58                $accepted_args = 2;
    5959                $arg           = __FUNCTION__ . '_arg';
    6060
     
    7474                $hook          = new WP_Hook();
    7575                $tag           = __FUNCTION__;
    76                 $priority      = rand( 1, 100 );
    77                 $accepted_args = rand( 1, 100 );
     76                $priority      = 1;
     77                $accepted_args = 2;
    7878                $arg           = __FUNCTION__ . '_arg';
    7979
     
    9090                $hook          = new WP_Hook();
    9191                $tag           = __FUNCTION__;
    92                 $priority      = rand( 1, 100 );
     92                $priority      = 1;
    9393                $accepted_args = 0;
    9494                $arg           = __FUNCTION__ . '_arg';
     
    104104                $hook          = new WP_Hook();
    105105                $tag           = __FUNCTION__;
    106                 $priority      = rand( 1, 100 );
     106                $priority      = 1;
    107107                $accepted_args = 1;
    108108                $arg           = __FUNCTION__ . '_arg';
     
    118118                $hook          = new WP_Hook();
    119119                $tag           = __FUNCTION__;
    120                 $priority      = rand( 1, 100 );
     120                $priority      = 100;
    121121                $accepted_args = 1000;
    122122                $arg           = __FUNCTION__ . '_arg';
  • trunk/tests/phpunit/tests/hooks/doAllHook.php

    r50342 r52389  
    1414                $hook          = new WP_Hook();
    1515                $tag           = 'all';
    16                 $priority      = rand( 1, 100 );
    17                 $accepted_args = rand( 1, 100 );
     16                $priority      = 1;
     17                $accepted_args = 2;
    1818                $arg           = 'all_arg';
    1919
  • trunk/tests/phpunit/tests/hooks/hasFilter.php

    r50342 r52389  
    1313                $hook          = new WP_Hook();
    1414                $tag           = __FUNCTION__;
    15                 $priority      = rand( 1, 100 );
    16                 $accepted_args = rand( 1, 100 );
     15                $priority      = 1;
     16                $accepted_args = 2;
    1717
    1818                $hook->add_filter( $tag, $callback, $priority, $accepted_args );
     
    2626                $hook          = new WP_Hook();
    2727                $tag           = __FUNCTION__;
    28                 $priority      = rand( 1, 100 );
    29                 $accepted_args = rand( 1, 100 );
     28                $priority      = 1;
     29                $accepted_args = 2;
    3030
    3131                $hook->add_filter( $tag, $callback, $priority, $accepted_args );
     
    3838                $hook          = new WP_Hook();
    3939                $tag           = __FUNCTION__;
    40                 $priority      = rand( 1, 100 );
    41                 $accepted_args = rand( 1, 100 );
     40                $priority      = 1;
     41                $accepted_args = 2;
    4242
    4343                $hook->add_filter( $tag, $callback, $priority, $accepted_args );
     
    5050                $hook          = new WP_Hook();
    5151                $tag           = __FUNCTION__;
    52                 $priority      = rand( 1, 100 );
    53                 $accepted_args = rand( 1, 100 );
     52                $priority      = 1;
     53                $accepted_args = 2;
    5454
    5555                $hook->add_filter( $tag, $callback, $priority, $accepted_args );
     
    7575                $hook          = new WP_Hook();
    7676                $tag           = __FUNCTION__;
    77                 $priority      = rand( 1, 100 );
    78                 $accepted_args = rand( 1, 100 );
     77                $priority      = 1;
     78                $accepted_args = 2;
    7979
    8080                $hook->add_filter( $tag, $callback, $priority, $accepted_args );
  • trunk/tests/phpunit/tests/hooks/hasFilters.php

    r50342 r52389  
    1313                $hook          = new WP_Hook();
    1414                $tag           = __FUNCTION__;
    15                 $priority      = rand( 1, 100 );
    16                 $accepted_args = rand( 1, 100 );
     15                $priority      = 1;
     16                $accepted_args = 2;
    1717
    1818                $hook->add_filter( $tag, $callback, $priority, $accepted_args );
     
    3030                $hook          = new WP_Hook();
    3131                $tag           = __FUNCTION__;
    32                 $priority      = rand( 1, 100 );
    33                 $accepted_args = rand( 1, 100 );
     32                $priority      = 1;
     33                $accepted_args = 2;
    3434
    3535                $hook->add_filter( $tag, $callback, $priority, $accepted_args );
     
    4242                $hook          = new WP_Hook();
    4343                $tag           = __FUNCTION__;
    44                 $priority      = rand( 1, 100 );
    45                 $accepted_args = rand( 1, 100 );
     44                $priority      = 1;
     45                $accepted_args = 2;
    4646
    4747                $hook->add_filter( $tag, $callback, $priority, $accepted_args );
  • trunk/tests/phpunit/tests/hooks/iterator.php

    r50342 r52389  
    1414                $hook          = new WP_Hook();
    1515                $tag           = __FUNCTION__;
    16                 $priority      = rand( 1, 100 );
    17                 $accepted_args = rand( 1, 100 );
     16                $priority      = 1;
     17                $accepted_args = 2;
    1818
    1919                $hook->add_filter( $tag, $callback_one, $priority, $accepted_args );
  • trunk/tests/phpunit/tests/hooks/preinitHooks.php

    r50342 r52389  
    1111        public function test_array_to_hooks() {
    1212                $tag1      = __FUNCTION__ . '_1';
    13                 $priority1 = rand( 1, 100 );
     13                $priority1 = 1;
    1414                $tag2      = __FUNCTION__ . '_2';
    15                 $priority2 = rand( 1, 100 );
     15                $priority2 = 2;
    1616                $filters   = array(
    1717                        $tag1 => array(
  • trunk/tests/phpunit/tests/hooks/removeAllFilters.php

    r50342 r52389  
    1313                $hook          = new WP_Hook();
    1414                $tag           = __FUNCTION__;
    15                 $priority      = rand( 1, 100 );
    16                 $accepted_args = rand( 1, 100 );
     15                $priority      = 1;
     16                $accepted_args = 2;
    1717
    1818                $hook->add_filter( $tag, $callback, $priority, $accepted_args );
     
    2828                $hook          = new WP_Hook();
    2929                $tag           = __FUNCTION__;
    30                 $priority      = rand( 1, 100 );
    31                 $accepted_args = rand( 1, 100 );
     30                $priority      = 1;
     31                $accepted_args = 2;
    3232
    3333                $hook->add_filter( $tag, $callback_one, $priority, $accepted_args );
  • trunk/tests/phpunit/tests/hooks/removeFilter.php

    r51397 r52389  
    1313                $hook          = new WP_Hook();
    1414                $tag           = __FUNCTION__;
    15                 $priority      = rand( 1, 100 );
    16                 $accepted_args = rand( 1, 100 );
     15                $priority      = 1;
     16                $accepted_args = 2;
    1717
    1818                $hook->add_filter( $tag, $callback, $priority, $accepted_args );
     
    2727                $hook          = new WP_Hook();
    2828                $tag           = __FUNCTION__;
    29                 $priority      = rand( 1, 100 );
    30                 $accepted_args = rand( 1, 100 );
     29                $priority      = 1;
     30                $accepted_args = 2;
    3131
    3232                $hook->add_filter( $tag, $callback, $priority, $accepted_args );
     
    4040                $hook          = new WP_Hook();
    4141                $tag           = __FUNCTION__;
    42                 $priority      = rand( 1, 100 );
    43                 $accepted_args = rand( 1, 100 );
     42                $priority      = 1;
     43                $accepted_args = 2;
    4444
    4545                $hook->add_filter( $tag, $callback, $priority, $accepted_args );
     
    5454                $hook          = new WP_Hook();
    5555                $tag           = __FUNCTION__;
    56                 $priority      = rand( 1, 100 );
    57                 $accepted_args = rand( 1, 100 );
     56                $priority      = 1;
     57                $accepted_args = 2;
    5858
    5959                $hook->add_filter( $tag, $callback_one, $priority, $accepted_args );
     
    7070                $hook          = new WP_Hook();
    7171                $tag           = __FUNCTION__;
    72                 $priority      = rand( 1, 100 );
    73                 $accepted_args = rand( 1, 100 );
     72                $priority      = 1;
     73                $accepted_args = 2;
    7474
    7575                $hook->add_filter( $tag, $callback_one, $priority, $accepted_args );
  • trunk/tests/phpunit/tests/image/intermediateSize.php

    r52010 r52389  
    182182         */
    183183        public function test_get_intermediate_sizes_by_array_zero_height() {
    184                 // Generate random width.
    185                 $random_w = rand( 300, 400 );
     184                // Use this width.
     185                $width = 300;
    186186
    187187                // Only one dimention match shouldn't return false positive (see: #17626).
    188                 add_image_size( 'test-size', $random_w, 0, false );
    189                 add_image_size( 'false-height', $random_w, 100, true );
     188                add_image_size( 'test-size', $width, 0, false );
     189                add_image_size( 'false-height', $width, 100, true );
    190190
    191191                $file = DIR_TESTDATA . '/images/waffles.jpg';
     
    193193
    194194                $original = wp_get_attachment_metadata( $id );
    195                 $image_w  = $random_w;
     195                $image_w  = $width;
    196196                $image_h  = round( ( $image_w / $original['width'] ) * $original['height'] );
    197197
    198198                // Look for a size by array that exists.
    199199                // Note: Staying larger than 300px to miss default medium crop.
    200                 $image = image_get_intermediate_size( $id, array( $random_w, 0 ) );
     200                $image = image_get_intermediate_size( $id, array( $width, 0 ) );
    201201
    202202                // Test for the expected string because the array will by definition
  • trunk/tests/phpunit/tests/post.php

    r52010 r52389  
    6969                                'post_author'  => self::$editor_id,
    7070                                'post_status'  => 'publish',
    71                                 'post_content' => rand_str(),
    72                                 'post_title'   => rand_str(),
     71                                'post_content' => "{$post_type}_content",
     72                                'post_title'   => "{$post_type}_title",
    7373                                'tax_input'    => array(
    7474                                        'post_tag' => 'tag1,tag2',
     
    127127                        'post_author'  => self::$editor_id,
    128128                        'post_status'  => 'publish',
    129                         'post_content' => rand_str(),
    130                         'post_title'   => rand_str(),
     129                        'post_content' => 'content',
     130                        'post_title'   => 'title',
    131131                        'post_date'    => date_format( date_create( "@{$future_date}" ), 'Y-m-d H:i:s' ),
    132132                );
     
    163163                        'post_author'  => self::$editor_id,
    164164                        'post_status'  => 'publish',
    165                         'post_content' => rand_str(),
    166                         'post_title'   => rand_str(),
     165                        'post_content' => 'content',
     166                        'post_title'   => 'title',
    167167                        'post_date'    => date_format( date_create( "@{$future_date_1}" ), 'Y-m-d H:i:s' ),
    168168                );
     
    208208                        'post_author'  => self::$editor_id,
    209209                        'post_status'  => 'publish',
    210                         'post_content' => rand_str(),
    211                         'post_title'   => rand_str(),
     210                        'post_content' => 'content',
     211                        'post_title'   => 'title',
    212212                        'post_date'    => date_format( date_create( "@{$future_date_1}" ), 'Y-m-d H:i:s' ),
    213213                );
     
    250250                        'post_author'  => self::$editor_id,
    251251                        'post_status'  => 'draft',
    252                         'post_content' => rand_str(),
    253                         'post_title'   => rand_str(),
     252                        'post_content' => 'content',
     253                        'post_title'   => 'title',
    254254                        'post_date'    => date_format( date_create( "@{$future_date}" ), 'Y-m-d H:i:s' ),
    255255                );
     
    285285                        'post_author'  => self::$editor_id,
    286286                        'post_status'  => 'publish',
    287                         'post_content' => rand_str(),
    288                         'post_title'   => rand_str(),
     287                        'post_content' => 'content',
     288                        'post_title'   => 'title',
    289289                        'post_date'    => date_format( date_create( "@{$future_date_1}" ), 'Y-m-d H:i:s' ),
    290290                );
     
    329329                                'post_author'  => self::$editor_id,
    330330                                'post_status'  => 'publish',
    331                                 'post_content' => rand_str(),
    332                                 'post_title'   => rand_str(),
     331                                'post_content' => "{$status}_content",
     332                                'post_title'   => "{$status}_title",
    333333                                'post_date'    => date_format( date_create( "@{$future_date_1}" ), 'Y-m-d H:i:s' ),
    334334                        );
     
    371371                        'post_author'  => self::$editor_id,
    372372                        'post_status'  => 'private',
    373                         'post_content' => rand_str(),
    374                         'post_title'   => rand_str(),
     373                        'post_content' => 'content',
     374                        'post_title'   => 'title',
    375375                        'post_date'    => date_format( date_create( "@{$future_date}" ), 'Y-m-d H:i:s' ),
    376376                );
     
    405405                        'post_author'  => self::$editor_id,
    406406                        'post_status'  => 'publish',
    407                         'post_content' => rand_str(),
    408                         'post_title'   => rand_str(),
     407                        'post_content' => 'content',
     408                        'post_title'   => 'title',
    409409                        'post_date'    => '2012-02-30 00:00:00',
    410410                );
     
    428428                        'post_author'  => self::$editor_id,
    429429                        'post_status'  => 'publish',
    430                         'post_content' => rand_str(),
    431                         'post_title'   => rand_str(),
     430                        'post_content' => 'content',
     431                        'post_title'   => 'title',
    432432                        'post_date'    => date_format( date_create( "@{$future_date_1}" ), 'Y-m-d H:i:s' ),
    433433                );
     
    534534                        'post_author'  => self::$editor_id,
    535535                        'post_status'  => 'publish',
    536                         'post_content' => rand_str(),
    537                         'post_title'   => rand_str(),
     536                        'post_content' => 'content',
     537                        'post_title'   => 'title',
    538538                        'post_date'    => date_format( date_create( "@{$future_date}" ), 'Y-m-d H:i:s' ),
    539539                );
     
    565565                        'post_author'  => self::$editor_id,
    566566                        'post_status'  => 'publish',
    567                         'post_content' => rand_str(),
     567                        'post_content' => 'content',
    568568                        'post_title'   => '',
    569569                        'post_date'    => '2007-10-31 06:15:00',
     
    783783                register_taxonomy( 'test_tax', 'post' );
    784784
    785                 $title          = rand_str();
     785                $title          = 'title';
    786786                $post_data      = array(
    787787                        'post_author'  => self::$editor_id,
    788788                        'post_status'  => 'publish',
    789                         'post_content' => rand_str(),
     789                        'post_content' => 'content',
    790790                        'post_title'   => $title,
    791791                        'tax_input'    => array(
     
    907907
    908908                $post = self::factory()->post->create( array( 'post_type' => $post_type ) );
    909                 wp_set_object_terms( $post, rand_str(), $tax );
     909                wp_set_object_terms( $post, 'foo', $tax );
    910910
    911911                $wp_tag_cloud = wp_tag_cloud(
     
    974974                                'post_author'  => self::$editor_id,
    975975                                'post_status'  => 'publish',
    976                                 'post_content' => rand_str(),
    977                                 'post_title'   => rand_str(),
     976                                'post_content' => 'content',
     977                                'post_title'   => 'title',
    978978                        )
    979979                );
     
    992992                                'post_author'  => self::$editor_id,
    993993                                'post_status'  => 'publish',
    994                                 'post_content' => rand_str(),
    995                                 'post_title'   => rand_str(),
     994                                'post_content' => 'content',
     995                                'post_title'   => 'title',
    996996                                'post_type'    => 'page',
    997997                        )
     
    12041204                        'post_author'   => self::$editor_id,
    12051205                        'post_status'   => 'publish',
    1206                         'post_content'  => rand_str(),
    1207                         'post_title'    => rand_str(),
     1206                        'post_content'  => 'content',
     1207                        'post_title'    => 'title',
    12081208                        'post_date_gmt' => '2014-01-01 12:00:00',
    12091209                );
  • trunk/tests/phpunit/tests/post/attachments.php

    r52010 r52389  
    273273                $post_id = wp_insert_post(
    274274                        array(
    275                                 'post_content' => rand_str(),
    276                                 'post_title'   => rand_str(),
     275                                'post_content' => 'content',
     276                                'post_title'   => 'title',
    277277                        )
    278278                );
  • trunk/tests/phpunit/tests/post/meta.php

    r52010 r52389  
    2424                                'post_author'  => self::$author->ID,
    2525                                'post_status'  => 'publish',
    26                                 'post_content' => rand_str(),
    27                                 'post_title'   => rand_str(),
     26                                'post_content' => 'content',
     27                                'post_title'   => 'title',
    2828                        )
    2929                );
     
    3333                                'post_author'  => self::$author->ID,
    3434                                'post_status'  => 'publish',
    35                                 'post_content' => rand_str(),
    36                                 'post_title'   => rand_str(),
     35                                'post_content' => 'content',
     36                                'post_title'   => 'title',
    3737                        )
    3838                );
  • trunk/tests/phpunit/tests/post/nav-menu.php

    r52248 r52389  
    1313                parent::set_up();
    1414
    15                 $this->menu_id = wp_create_nav_menu( rand_str() );
     15                $this->menu_id = wp_create_nav_menu( 'foo' );
    1616        }
    1717
     
    256256        public function test_wp_setup_nav_menu_item_for_post_type_archive() {
    257257
    258                 $post_type_slug        = rand_str( 12 );
    259                 $post_type_description = rand_str();
     258                $post_type_slug        = 'fooo-bar-baz';
     259                $post_type_description = 'foo';
    260260                register_post_type(
    261261                        $post_type_slug,
     
    289289        public function test_wp_setup_nav_menu_item_for_post_type_archive_no_description() {
    290290
    291                 $post_type_slug        = rand_str( 12 );
     291                $post_type_slug        = 'fooo-bar-baz';
    292292                $post_type_description = '';
    293293                register_post_type(
     
    320320        public function test_wp_setup_nav_menu_item_for_post_type_archive_custom_description() {
    321321
    322                 $post_type_slug        = rand_str( 12 );
    323                 $post_type_description = rand_str();
     322                $post_type_slug        = 'fooo-bar-baz';
     323                $post_type_description = 'foobaz';
    324324                register_post_type(
    325325                        $post_type_slug,
     
    332332                );
    333333
    334                 $menu_item_description = rand_str();
     334                $menu_item_description = 'foo_description';
    335335
    336336                $post_type_archive_item_id = wp_update_nav_menu_item(
     
    355355        public function test_wp_setup_nav_menu_item_for_unknown_post_type_archive_no_description() {
    356356
    357                 $post_type_slug = rand_str( 12 );
     357                $post_type_slug = 'fooo-bar-baz';
    358358
    359359                $post_type_archive_item_id = wp_update_nav_menu_item(
  • trunk/tests/phpunit/tests/post/query.php

    r52010 r52389  
    133133                        array(
    134134                                'post_type'  => 'page',
    135                                 'menu_order' => rand( 1, 100 ),
     135                                'menu_order' => 1,
    136136                        )
    137137                );
     
    139139                        array(
    140140                                'post_type'  => 'page',
    141                                 'menu_order' => rand( 1, 100 ),
     141                                'menu_order' => 2,
    142142                        )
    143143                );
     
    146146                                'post_type'   => 'page',
    147147                                'post_parent' => $post_id2,
    148                                 'menu_order'  => rand( 1, 100 ),
     148                                'menu_order'  => 3,
    149149                        )
    150150                );
     
    153153                                'post_type'   => 'page',
    154154                                'post_parent' => $post_id2,
    155                                 'menu_order'  => rand( 1, 100 ),
     155                                'menu_order'  => 4,
    156156                        )
    157157                );
     
    159159                        array(
    160160                                'post_type'  => 'page',
    161                                 'menu_order' => rand( 1, 100 ),
     161                                'menu_order' => 5,
    162162                        )
    163163                );
     
    220220                        array(
    221221                                'post_mime_type' => 'image/jpeg',
    222                                 'menu_order'     => rand( 1, 100 ),
     222                                'menu_order'     => 1,
    223223                        )
    224224                );
     
    228228                        array(
    229229                                'post_mime_type' => 'image/jpeg',
    230                                 'menu_order'     => rand( 1, 100 ),
     230                                'menu_order'     => 2,
    231231                        )
    232232                );
     
    236236                        array(
    237237                                'post_mime_type' => 'image/jpeg',
    238                                 'menu_order'     => rand( 1, 100 ),
     238                                'menu_order'     => 3,
    239239                        )
    240240                );
     
    244244                        array(
    245245                                'post_mime_type' => 'image/jpeg',
    246                                 'menu_order'     => rand( 1, 100 ),
     246                                'menu_order'     => 4,
    247247                        )
    248248                );
     
    252252                        array(
    253253                                'post_mime_type' => 'image/jpeg',
    254                                 'menu_order'     => rand( 1, 100 ),
     254                                'menu_order'     => 5,
    255255                        )
    256256                );
  • trunk/tests/phpunit/tests/post/revisions.php

    r52095 r52389  
    1818        public function set_up() {
    1919                parent::set_up();
    20                 $this->post_type = rand_str( 20 );
     20                $this->post_type = 'test-revision';
    2121        }
    2222
     
    447447                                'post_status'  => 'publish',
    448448                                'ID'           => $post_id,
    449                                 'post_content' => rand_str(),
     449                                'post_content' => 'content',
    450450                        )
    451451                );
  • trunk/tests/phpunit/tests/post/types.php

    r52010 r52389  
    2222                parent::set_up();
    2323
    24                 $this->post_type = rand_str( 20 );
     24                $this->post_type = 'foo1';
    2525        }
    2626
  • trunk/tests/phpunit/tests/query/commentCount.php

    r52248 r52389  
    2222                $post_id             = $factory->post->create(
    2323                        array(
    24                                 'post_content' => 1 . rand_str() . ' about',
     24                                'post_content' => '1 about',
    2525                                'post_type'    => self::$post_type,
    2626                        )
     
    3131                $post_id             = $factory->post->create(
    3232                        array(
    33                                 'post_content' => 1 . rand_str() . ' about',
     33                                'post_content' => '2 about',
    3434                                'post_type'    => self::$post_type,
    3535                        )
     
    4242                $post_id             = $factory->post->create(
    4343                        array(
    44                                 'post_content' => 1 . rand_str() . ' about',
     44                                'post_content' => '3 about',
    4545                                'post_type'    => self::$post_type,
    4646                        )
     
    5353                $post_id             = $factory->post->create(
    5454                        array(
    55                                 'post_content' => 1 . rand_str() . ' about',
     55                                'post_content' => '4 about',
    5656                                'post_type'    => self::$post_type,
    5757                        )
  • trunk/tests/phpunit/tests/query/search.php

    r52010 r52389  
    1111                parent::set_up();
    1212
    13                 $this->post_type = rand_str( 12 );
     13                $this->post_type = 'foo1';
    1414                register_post_type( $this->post_type );
    1515
     
    3737                        self::factory()->post->create(
    3838                                array(
    39                                         'post_content' => $i . rand_str() . ' about',
     39                                        'post_content' => "{$i} about",
    4040                                        'post_type'    => $this->post_type,
    4141                                )
  • trunk/tests/phpunit/tests/query/taxQuery.php

    r51367 r52389  
    12101210                $tag_id   = self::factory()->term->create(
    12111211                        array(
    1212                                 'slug' => rand_str(),
    1213                                 'name' => rand_str(),
     1212                                'slug' => 'foo-bar',
     1213                                'name' => 'Foo Bar',
    12141214                        )
    12151215                );
  • trunk/tests/phpunit/tests/rest-api/rest-attachments-controller.php

    r52068 r52389  
    523523        public function test_get_items_invalid_date() {
    524524                $request = new WP_REST_Request( 'GET', '/wp/v2/media' );
    525                 $request->set_param( 'after', rand_str() );
    526                 $request->set_param( 'before', rand_str() );
     525                $request->set_param( 'after', 'foo' );
     526                $request->set_param( 'before', 'bar' );
    527527                $response = rest_get_server()->dispatch( $request );
    528528                $this->assertErrorResponse( 'rest_invalid_param', $response, 400 );
     
    571571        public function test_get_items_invalid_modified_date() {
    572572                $request = new WP_REST_Request( 'GET', '/wp/v2/media' );
    573                 $request->set_param( 'modified_after', rand_str() );
    574                 $request->set_param( 'modified_before', rand_str() );
     573                $request->set_param( 'modified_after', 'foo' );
     574                $request->set_param( 'modified_before', 'bar' );
    575575                $response = rest_get_server()->dispatch( $request );
    576576                $this->assertErrorResponse( 'rest_invalid_param', $response, 400 );
  • trunk/tests/phpunit/tests/rest-api/rest-comments-controller.php

    r51568 r52389  
    889889        public function test_get_comments_invalid_date() {
    890890                $request = new WP_REST_Request( 'GET', '/wp/v2/comments' );
    891                 $request->set_param( 'after', rand_str() );
    892                 $request->set_param( 'before', rand_str() );
     891                $request->set_param( 'after', 'foo' );
     892                $request->set_param( 'before', 'bar' );
    893893                $response = rest_get_server()->dispatch( $request );
    894894                $this->assertErrorResponse( 'rest_invalid_param', $response, 400 );
     
    14781478                        'author_url'   => 'http://timothylovejoy.jr',
    14791479                        'content'      => 'It\'s all over\, people! We don\'t have a prayer!',
    1480                         'date'         => rand_str(),
     1480                        'date'         => 'foo-bar',
    14811481                );
    14821482
     
    26262626
    26272627                $params = array(
    2628                         'content' => rand_str(),
    2629                         'date'    => rand_str(),
     2628                        'content' => 'content',
     2629                        'date'    => 'foo',
    26302630                );
    26312631
     
    26422642
    26432643                $params = array(
    2644                         'content'  => rand_str(),
    2645                         'date_gmt' => rand_str(),
     2644                        'content'  => 'content',
     2645                        'date_gmt' => 'foo',
    26462646                );
    26472647
     
    27712771                $request = new WP_REST_Request( 'PUT', sprintf( '/wp/v2/comments/%s', $child_comment ) );
    27722772                $request->set_param( 'parent', $comment_id_1 );
    2773                 $request->set_param( 'content', rand_str() );
     2773                $request->set_param( 'content', 'foo bar' );
    27742774                $response = rest_get_server()->dispatch( $request );
    27752775                $this->assertSame( 200, $response->get_status() );
  • trunk/tests/phpunit/tests/rest-api/rest-pages-controller.php

    r52068 r52389  
    331331        public function test_get_items_invalid_date() {
    332332                $request = new WP_REST_Request( 'GET', '/wp/v2/pages' );
    333                 $request->set_param( 'after', rand_str() );
    334                 $request->set_param( 'before', rand_str() );
     333                $request->set_param( 'after', 'foo' );
     334                $request->set_param( 'before', 'bar' );
    335335                $response = rest_get_server()->dispatch( $request );
    336336                $this->assertErrorResponse( 'rest_invalid_param', $response, 400 );
     
    370370        public function test_get_items_invalid_modified_date() {
    371371                $request = new WP_REST_Request( 'GET', '/wp/v2/pages' );
    372                 $request->set_param( 'modified_after', rand_str() );
    373                 $request->set_param( 'modified_before', rand_str() );
     372                $request->set_param( 'modified_after', 'foo' );
     373                $request->set_param( 'modified_before', 'bar' );
    374374                $response = rest_get_server()->dispatch( $request );
    375375                $this->assertErrorResponse( 'rest_invalid_param', $response, 400 );
  • trunk/tests/phpunit/tests/rest-api/rest-posts-controller.php

    r52310 r52389  
    16951695        public function test_get_items_invalid_date() {
    16961696                $request = new WP_REST_Request( 'GET', '/wp/v2/posts' );
    1697                 $request->set_param( 'after', rand_str() );
    1698                 $request->set_param( 'before', rand_str() );
     1697                $request->set_param( 'after', 'foo' );
     1698                $request->set_param( 'before', 'bar' );
    16991699                $response = rest_get_server()->dispatch( $request );
    17001700                $this->assertErrorResponse( 'rest_invalid_param', $response, 400 );
     
    17201720        public function test_get_items_invalid_modified_date() {
    17211721                $request = new WP_REST_Request( 'GET', '/wp/v2/posts' );
    1722                 $request->set_param( 'modified_after', rand_str() );
    1723                 $request->set_param( 'modified_before', rand_str() );
     1722                $request->set_param( 'modified_after', 'foo' );
     1723                $request->set_param( 'modified_before', 'bar' );
    17241724                $response = rest_get_server()->dispatch( $request );
    17251725                $this->assertErrorResponse( 'rest_invalid_param', $response, 400 );
     
    26982698                        array(
    26992699                                'post_mime_type' => 'image/jpeg',
    2700                                 'menu_order'     => rand( 1, 100 ),
     2700                                'menu_order'     => 1,
    27012701                        )
    27022702                );
     
    33113311                wp_set_current_user( self::$editor_id );
    33123312
    3313                 $new_content       = rand_str();
     3313                $new_content       = 'foo bar baz';
    33143314                $expected_modified = current_time( 'mysql' );
    33153315
     
    33763376                $params  = $this->set_post_data(
    33773377                        array(
    3378                                 'date' => rand_str(),
     3378                                'date' => 'foo',
    33793379                        )
    33803380                );
     
    33913391                $params  = $this->set_post_data(
    33923392                        array(
    3393                                 'date_gmt' => rand_str(),
     3393                                'date_gmt' => 'foo',
    33943394                        )
    33953395                );
  • trunk/tests/phpunit/tests/rewrite.php

    r52010 r52389  
    174174                delete_option( 'rewrite_rules' );
    175175
    176                 $post_type = rand_str( 12 );
     176                $post_type = 'url_to_postid';
    177177                register_post_type( $post_type, array( 'public' => true ) );
    178178
  • trunk/tests/phpunit/tests/rewrite/numericSlugs.php

    r51568 r52389  
    2424                                'post_author'  => $this->author_id,
    2525                                'post_status'  => 'publish',
    26                                 'post_content' => rand_str(),
     26                                'post_content' => 'content',
    2727                                'post_title'   => '',
    2828                                'post_name'    => '2015',
     
    5454                                'post_author'  => $this->author_id,
    5555                                'post_status'  => 'publish',
    56                                 'post_content' => rand_str(),
     56                                'post_content' => 'content',
    5757                                'post_title'   => '',
    5858                                'post_name'    => '2015',
     
    8181                                'post_author'  => $this->author_id,
    8282                                'post_status'  => 'publish',
    83                                 'post_content' => rand_str(),
     83                                'post_content' => 'content',
    8484                                'post_title'   => '2015',
    8585                                'post_date'    => '2015-02-01 01:00:00',
     
    9999                                'post_author'  => $this->author_id,
    100100                                'post_status'  => 'publish',
    101                                 'post_content' => rand_str(),
     101                                'post_content' => 'content',
    102102                                'post_title'   => '2015',
    103103                                'post_date'    => '2015-02-01 01:00:00',
     
    115115                                'post_author'  => $this->author_id,
    116116                                'post_status'  => 'publish',
    117                                 'post_content' => rand_str(),
     117                                'post_content' => 'content',
    118118                                'post_title'   => '',
    119119                                'post_name'    => '02',
     
    134134                                'post_author'  => $this->author_id,
    135135                                'post_status'  => 'publish',
    136                                 'post_content' => rand_str(),
     136                                'post_content' => 'content',
    137137                                'post_title'   => '',
    138138                                'post_name'    => '02',
     
    151151                                'post_author'  => $this->author_id,
    152152                                'post_status'  => 'publish',
    153                                 'post_content' => rand_str(),
     153                                'post_content' => 'content',
    154154                                'post_title'   => '',
    155155                                'post_name'    => '2',
     
    170170                                'post_author'  => $this->author_id,
    171171                                'post_status'  => 'publish',
    172                                 'post_content' => rand_str(),
     172                                'post_content' => 'content',
    173173                                'post_title'   => '',
    174174                                'post_name'    => '2',
     
    187187                                'post_author'  => $this->author_id,
    188188                                'post_status'  => 'publish',
    189                                 'post_content' => rand_str(),
     189                                'post_content' => 'content',
    190190                                'post_title'   => '02',
    191191                                'post_date'    => '2015-02-01 01:00:00',
     
    205205                                'post_author'  => $this->author_id,
    206206                                'post_status'  => 'publish',
    207                                 'post_content' => rand_str(),
     207                                'post_content' => 'content',
    208208                                'post_title'   => '02',
    209209                                'post_date'    => '2015-02-01 01:00:00',
     
    221221                                'post_author'  => $this->author_id,
    222222                                'post_status'  => 'publish',
    223                                 'post_content' => rand_str(),
     223                                'post_content' => 'content',
    224224                                'post_title'   => '2',
    225225                                'post_date'    => '2015-02-01 01:00:00',
     
    239239                                'post_author'  => $this->author_id,
    240240                                'post_status'  => 'publish',
    241                                 'post_content' => rand_str(),
     241                                'post_content' => 'content',
    242242                                'post_title'   => '2',
    243243                                'post_date'    => '2015-02-01 01:00:00',
     
    255255                                'post_author'  => $this->author_id,
    256256                                'post_status'  => 'publish',
    257                                 'post_content' => rand_str(),
     257                                'post_content' => 'content',
    258258                                'post_title'   => '',
    259259                                'post_name'    => '01',
     
    274274                                'post_author'  => $this->author_id,
    275275                                'post_status'  => 'publish',
    276                                 'post_content' => rand_str(),
     276                                'post_content' => 'content',
    277277                                'post_title'   => '',
    278278                                'post_name'    => '01',
     
    291291                                'post_author'  => $this->author_id,
    292292                                'post_status'  => 'publish',
    293                                 'post_content' => rand_str(),
     293                                'post_content' => 'content',
    294294                                'post_title'   => '01',
    295295                                'post_date'    => '2015-02-01 01:00:00',
     
    309309                                'post_author'  => $this->author_id,
    310310                                'post_status'  => 'publish',
    311                                 'post_content' => rand_str(),
     311                                'post_content' => 'content',
    312312                                'post_title'   => '01',
    313313                                'post_date'    => '2015-02-01 01:00:00',
     
    325325                                'post_author'  => $this->author_id,
    326326                                'post_status'  => 'publish',
    327                                 'post_content' => rand_str(),
     327                                'post_content' => 'content',
    328328                                'post_title'   => '01',
    329329                                'post_date'    => '2015-02-01 01:00:00',
  • trunk/tests/phpunit/tests/taxonomy.php

    r52010 r52389  
    1818        public function test_get_unknown_taxonomies() {
    1919                // Taxonomies for an unknown object type.
    20                 $this->assertSame( array(), get_object_taxonomies( rand_str() ) );
     20                $this->assertSame( array(), get_object_taxonomies( 'unknown' ) );
    2121                $this->assertSame( array(), get_object_taxonomies( '' ) );
    2222                $this->assertSame( array(), get_object_taxonomies( 0 ) );
     
    145145
    146146                // Make up a new taxonomy name, and ensure it's unused.
    147                 $tax = rand_str();
     147                $tax = 'tax_new';
    148148                $this->assertFalse( taxonomy_exists( $tax ) );
    149149
     
    159159
    160160                // Make up a new taxonomy name, and ensure it's unused.
    161                 $tax = rand_str();
     161                $tax = 'tax_new';
    162162                $this->assertFalse( taxonomy_exists( $tax ) );
    163163
  • trunk/tests/phpunit/tests/term.php

    r52010 r52389  
    5252        public function test_is_term_type() {
    5353                // Insert a term.
    54                 $term = rand_str();
     54                $term = 'term_new';
    5555                $t    = wp_insert_term( $term, $this->taxonomy );
    5656                $this->assertIsArray( $t );
    5757                $term_obj = get_term_by( 'name', $term, $this->taxonomy );
    58                 $this->assertEquals( $t['term_id'], term_exists( $term_obj->slug ) );
    59 
     58
     59                $exists = term_exists( $term_obj->slug );
    6060                // Clean up.
    61                 $this->assertTrue( wp_delete_term( $t['term_id'], $this->taxonomy ) );
     61                $deleted = wp_delete_term( $t['term_id'], $this->taxonomy );
     62
     63                $this->assertEquals( $t['term_id'], $exists );
     64                $this->assertTrue( $deleted );
    6265        }
    6366
  • trunk/tests/phpunit/tests/term/getTermField.php

    r52010 r52389  
    9292
    9393        public function test_get_term_field_name() {
    94                 $name = rand_str( 15 );
     94                $name = 'baz';
    9595
    9696                $term = self::factory()->term->create_and_get(
     
    107107
    108108        public function test_get_term_field_slug_when_slug_is_set() {
    109                 $slug = rand_str( 15 );
     109                $slug = 'baz';
    110110
    111111                $term = self::factory()->term->create_and_get(
     
    122122
    123123        public function test_get_term_field_slug_when_slug_falls_back_from_name() {
    124                 $name = rand_str( 15 );
     124                $name = 'baz';
    125125
    126126                $term = self::factory()->term->create_and_get(
     
    157157
    158158        public function test_get_term_field_description() {
    159                 $desc = wpautop( rand_str() );
     159                $desc = wpautop( 'baz' );
    160160
    161161                $term = self::factory()->term->create_and_get(
  • trunk/tests/phpunit/tests/term/splitSharedTerm.php

    r51568 r52389  
    209209                );
    210210
    211                 $menu_id       = wp_create_nav_menu( rand_str() );
     211                $menu_id       = wp_create_nav_menu( 'Nav Menu Bar' );
    212212                $cat_menu_item = wp_update_nav_menu_item(
    213213                        $menu_id,
  • trunk/tests/phpunit/tests/term/termExists.php

    r52010 r52389  
    261261
    262262                // Insert a term.
    263                 $term = rand_str();
     263                $term = __FUNCTION__;
    264264                $t    = wp_insert_term( $term, 'wptests_tax' );
    265265                $this->assertIsArray( $t );
  • trunk/tests/phpunit/tests/term/wpSetObjectTerms.php

    r52010 r52389  
    134134
    135135                $terms = array(
    136                         rand_str(),
    137                         rand_str(),
    138                         rand_str(),
     136                        'term0',
     137                        'term1',
     138                        'term2',
    139139                );
    140140
     
    165165        public function test_set_object_terms_invalid() {
    166166                // Bogus taxonomy.
    167                 $result = wp_set_object_terms( self::$post_ids[0], array( rand_str() ), rand_str() );
     167                $result = wp_set_object_terms( self::$post_ids[0], array( 'foo' ), 'invalid-taxonomy' );
    168168                $this->assertWPError( $result );
    169169        }
  • trunk/tests/phpunit/tests/term/wpTaxonomy.php

    r51404 r52389  
    1919                global $wp;
    2020
    21                 $taxonomy        = rand_str();
     21                $taxonomy        = 'taxonomy1';
    2222                $taxonomy_object = new WP_Taxonomy( $taxonomy, 'post' );
    2323
     
    3232                global $wp;
    3333
    34                 $taxonomy        = rand_str();
     34                $taxonomy        = 'taxonomy2';
    3535                $taxonomy_object = new WP_Taxonomy(
    3636                        $taxonomy,
     
    5959                global $wp_rewrite;
    6060
    61                 $taxonomy        = rand_str();
     61                $taxonomy        = 'taxonomy3';
    6262                $taxonomy_object = new WP_Taxonomy(
    6363                        $taxonomy,
     
    8080
    8181        public function test_adds_ajax_callback() {
    82                 $taxonomy        = rand_str();
     82                $taxonomy        = 'taxonomy4';
    8383                $taxonomy_object = new WP_Taxonomy(
    8484                        $taxonomy,
  • trunk/tests/phpunit/tests/theme.php

    r52386 r52389  
    300300
    301301                                // Template file that doesn't exist.
    302                                 $this->assertSame( '', get_query_template( rand_str() ) );
     302                                $this->assertSame( '', get_query_template( 'nonexistant' ) );
    303303
    304304                                // Template files that do exist.
     
    334334        public function test_switch_theme_bogus() {
    335335                // Try switching to a theme that doesn't exist.
    336                 $template = rand_str();
    337                 $style    = rand_str();
     336                $template = 'some_template';
     337                $style    = 'some_style';
    338338                update_option( 'template', $template );
    339339                update_option( 'stylesheet', $style );
  • trunk/tests/phpunit/tests/user.php

    r52352 r52389  
    105105
    106106                // Change and get again.
    107                 $val2 = rand_str();
     107                $val2 = 'baz';
    108108                update_user_option( self::$author_id, $key, $val2 );
    109109                $this->assertSame( $val2, get_user_option( $key, self::$author_id ) );
     
    136136                update_user_meta( self::$author_id, $key, $val );
    137137                // Incorrect key: key still exists.
    138                 delete_user_meta( self::$author_id, $key, rand_str() );
     138                delete_user_meta( self::$author_id, $key, 'foo' );
    139139                $this->assertSame( $val, get_user_meta( self::$author_id, $key, true ) );
    140140                // Correct key: deleted.
     
    150150                // Some values to set.
    151151                $vals = array(
    152                         rand_str() => 'val-' . rand_str(),
    153                         rand_str() => 'val-' . rand_str(),
    154                         rand_str() => 'val-' . rand_str(),
     152                        'key0' => 'val0',
     153                        'key1' => 'val1',
     154                        'key2' => 'val2',
    155155                );
    156156
     
    476476                        'post_author'  => self::$author_id,
    477477                        'post_status'  => 'publish',
    478                         'post_content' => rand_str(),
    479                         'post_title'   => rand_str(),
     478                        'post_content' => 'content',
     479                        'post_title'   => 'title',
    480480                        'post_type'    => 'post',
    481481                );
     
    637637                $id1 = wp_insert_user(
    638638                        array(
    639                                 'user_login' => rand_str(),
     639                                'user_login' => 'taco_burrito',
    640640                                'user_pass'  => 'password',
    641641                                'user_email' => 'taco@burrito.com',
     
    646646                $id2 = wp_insert_user(
    647647                        array(
    648                                 'user_login' => rand_str(),
     648                                'user_login' => 'taco_burrito2',
    649649                                'user_pass'  => 'password',
    650650                                'user_email' => 'taco@burrito.com',
     
    827827        public function test_wp_insert_user_should_not_wipe_existing_password() {
    828828                $user_details = array(
    829                         'user_login' => rand_str(),
     829                        'user_login' => 'jonsnow',
    830830                        'user_pass'  => 'password',
    831                         'user_email' => rand_str() . '@example.com',
     831                        'user_email' => 'jonsnow@example.com',
    832832                );
    833833
  • trunk/tests/phpunit/tests/user/author.php

    r52010 r52389  
    2727                                'post_author'  => self::$author_id,
    2828                                'post_status'  => 'publish',
    29                                 'post_content' => rand_str(),
    30                                 'post_title'   => rand_str(),
     29                                'post_content' => 'content',
     30                                'post_title'   => 'title',
    3131                                'post_type'    => 'post',
    3232                        )
  • trunk/tests/phpunit/tests/xmlrpc/wp/editProfile.php

    r52010 r52389  
    1717
    1818                $new_data = array(
    19                         'first_name'   => rand_str(),
    20                         'last_name'    => rand_str(),
     19                        'first_name'   => 'firstname',
     20                        'last_name'    => 'lastname',
    2121                        'url'          => 'http://www.example.org/subscriber',
    22                         'display_name' => rand_str(),
    23                         'nickname'     => rand_str(),
    24                         'nicename'     => rand_str(),
    25                         'bio'          => rand_str( 200 ),
     22                        'display_name' => 'displayname',
     23                        'nickname'     => 'nickname',
     24                        'nicename'     => 'nicename',
     25                        'bio'          => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.',
    2626                );
    2727                $result   = $this->myxmlrpcserver->wp_editProfile( array( 1, 'subscriber', 'subscriber', $new_data ) );
  • trunk/tests/phpunit/tests/xmlrpc/wp/getComment.php

    r52010 r52389  
    1919                        'comment_author_url'   => 'http://example.com/',
    2020                        'comment_author_email' => 'example@example.com',
    21                         'comment_content'      => rand_str( 100 ),
     21                        'comment_content'      => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.',
    2222                );
    2323                self::$parent_comment_id   = wp_insert_comment( self::$parent_comment_data );
     
    2929                        'comment_author_email' => 'example@example.org',
    3030                        'comment_parent'       => self::$parent_comment_id,
    31                         'comment_content'      => rand_str( 100 ),
     31                        'comment_content'      => 'Duis non neque cursus, commodo massa in, bibendum nisl.',
    3232                );
    3333                self::$child_comment_id   = wp_insert_comment( self::$child_comment_data );
  • trunk/tests/phpunit/tests/xmlrpc/wp/getPost.php

    r52010 r52389  
    1515                $this->post_date_ts            = strtotime( '+1 day' );
    1616                $this->post_data               = array(
    17                         'post_title'   => rand_str(),
    18                         'post_content' => rand_str( 2000 ),
    19                         'post_excerpt' => rand_str( 100 ),
     17                        'post_title'   => 'Post Title',
     18                        'post_content' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.',
     19                        'post_excerpt' => 'Post Excerpt',
    2020                        'post_author'  => $this->make_user_by_role( 'author' ),
    2121                        'post_date'    => date_format( date_create( "@{$this->post_date_ts}" ), 'Y-m-d H:i:s' ),
  • trunk/tests/phpunit/tests/xmlrpc/wp/newComment.php

    r52010 r52389  
    5656                                self::$posts['publish']->ID,
    5757                                array(
    58                                         'content' => rand_str( 100 ),
     58                                        'content' => 'Content',
    5959                                ),
    6060                        )
     
    156156                                $post->ID,
    157157                                array(
    158                                         'content' => rand_str( 100 ),
     158                                        'content' => 'Content',
    159159                                ),
    160160                        )
     
    172172                        self::$posts['publish']->ID,
    173173                        array(
    174                                 'content' => rand_str( 100 ),
     174                                'content' => 'Content',
    175175                        ),
    176176                );
Note: See TracChangeset for help on using the changeset viewer.