Make WordPress Core

Changeset 48324


Ignore:
Timestamp:
07/05/2020 07:22:24 PM (4 years ago)
Author:
azaozz
Message:

Build/Test Tools: update PHPUnit tests after [48323]. Disable and keep the specific jQuery Migrate dependency tests for use in WP 5.6.

See #37110.

Location:
trunk/tests/phpunit/tests/dependencies
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/dependencies/jquery.php

    r46586 r48324  
    2222        $object = $scripts->query( 'jquery', 'registered' );
    2323        $this->assertInstanceOf( '_WP_Dependency', $object );
     24
     25        // As of 5.5 jQuery 1.12.4 is loaded without Migrate 1.4.1.
     26        // Disable, but keep the followint test for 5.6 when jQuery would be updated to 3.5.1+ and
     27        // the latest Migrate will be used.
     28        /*
    2429        $this->assertEqualSets( $object->deps, array_keys( $jquery_scripts ) );
    2530        foreach ( $object->deps as $dep ) {
     
    2934            $this->assertEquals( $jquery_scripts[ $dep ], $o->src );
    3035        }
     36        */
    3137    }
    3238
     
    114120        }
    115121
    116         $this->expectOutputRegex( '/^(?:<script[^>]+><\/script>\\n){2}$/' );
     122        // Match only one script tag fopr 5.5, revert to `{2}` for 5.6.
     123        $this->expectOutputRegex( '/^(?:<script[^>]+><\/script>\\n)$/' );
    117124
    118125        $scripts->do_items( false, 0 );
     
    123130        $scripts->do_items( false, 1 );
    124131        $this->assertContains( 'jquery', $scripts->done );
     132
     133        // Disable for 5.5 but keep for use in 5.6. See test_location_of_jquery() above.
     134        /*
    125135        $this->assertContains( 'jquery-core', $scripts->done, 'jquery-core in footer' );
    126136        $this->assertContains( 'jquery-migrate', $scripts->done, 'jquery-migrate in footer' );
     137        */
    127138    }
    128139}
  • trunk/tests/phpunit/tests/dependencies/scripts.php

    r48295 r48324  
    633633
    634634        $ver       = get_bloginfo( 'version' );
    635         $expected  = "<script type='text/javascript' src='/wp-admin/load-scripts.php?c=0&amp;load%5Bchunk_0%5D=jquery-core,jquery-migrate&amp;ver={$ver}'></script>\n";
     635        $expected  = "<script type='text/javascript' src='/wp-admin/load-scripts.php?c=0&amp;load%5Bchunk_0%5D=jquery&amp;ver={$ver}'></script>\n";
    636636        $expected .= "<script type='text/javascript' src='http://example.com' id='test-example-js'></script>\n";
    637637        $expected .= "<script type='text/javascript' id='test-example-js-after'>\nconsole.log(\"after\");\n</script>\n";
     
    658658
    659659        $ver       = get_bloginfo( 'version' );
    660         $expected  = "<script type='text/javascript' src='/wp-admin/load-scripts.php?c=0&amp;load%5Bchunk_0%5D=jquery-core,jquery-migrate&amp;ver={$ver}'></script>\n";
     660        $expected  = "<script type='text/javascript' src='/wp-admin/load-scripts.php?c=0&amp;load%5Bchunk_0%5D=jquery&amp;ver={$ver}'></script>\n";
    661661        $expected .= "<!--[if gte IE 9]>\n";
    662662        $expected .= "<script type='text/javascript' src='http://example.com' id='test-example-js'></script>\n";
     
    687687
    688688        $ver       = get_bloginfo( 'version' );
    689         $expected  = "<script type='text/javascript' src='/wp-admin/load-scripts.php?c=0&amp;load%5Bchunk_0%5D=jquery-core,jquery-migrate&amp;ver={$ver}'></script>\n";
     689        $expected  = "<script type='text/javascript' src='/wp-admin/load-scripts.php?c=0&amp;load%5Bchunk_0%5D=jquery&amp;ver={$ver}'></script>\n";
    690690        $expected .= "<script type='text/javascript' id='test-example-js-before'>\nconsole.log(\"before\");\n</script>\n";
    691691        $expected .= "<script type='text/javascript' src='http://example.com' id='test-example-js'></script>\n";
     
    713713
    714714        $ver       = get_bloginfo( 'version' );
    715         $expected  = "<script type='text/javascript' src='/wp-admin/load-scripts.php?c=0&amp;load%5Bchunk_0%5D=jquery-core,jquery-migrate&amp;ver={$ver}'></script>\n";
     715        $expected  = "<script type='text/javascript' src='/wp-admin/load-scripts.php?c=0&amp;load%5Bchunk_0%5D=jquery&amp;ver={$ver}'></script>\n";
    716716        $expected .= "<script type='text/javascript' id='test-example-js-before'>\nconsole.log(\"before\");\n</script>\n";
    717717        $expected .= "<script type='text/javascript' src='http://example.com' id='test-example-js'></script>\n";
Note: See TracChangeset for help on using the changeset viewer.