Make WordPress Core


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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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(
Note: See TracChangeset for help on using the changeset viewer.