WordPress.org

Make WordPress Core

Ticket #46218: 46218.diff

File 46218.diff, 3.5 KB (added by pento, 10 months ago)
  • Gruntfile.js

    diff --git a/Gruntfile.js b/Gruntfile.js
    index 41c3edd2a8..888daa366e 100644
    a b module.exports = function(grunt) { 
    171171                                                [ WORKING_DIR + 'wp-includes/js/jquery/jquery-migrate.js' ]: [ './node_modules/jquery-migrate/dist/jquery-migrate.js' ],
    172172                                                [ WORKING_DIR + 'wp-includes/js/jquery/jquery-migrate.min.js' ]: [ './node_modules/jquery-migrate/dist/jquery-migrate.min.js' ],
    173173                                                [ WORKING_DIR + 'wp-includes/js/jquery/jquery.form.js' ]: [ './node_modules/jquery-form/src/jquery.form.js' ],
    174                                                 [ WORKING_DIR + 'wp-includes/js/jquery/jquery.form.min.js' ]: [ './node_modules/jquery-form/dist/jquery.form.min.js' ],
    175174                                                [ WORKING_DIR + 'wp-includes/js/jquery/jquery.js' ]: [ './node_modules/jquery/dist/jquery.min.js' ],
    176175                                                [ WORKING_DIR + 'wp-includes/js/masonry.min.js' ]: [ './node_modules/masonry-layout/dist/masonry.pkgd.min.js' ],
    177176                                                [ WORKING_DIR + 'wp-includes/js/twemoji.js' ]: [ './node_modules/twemoji/2/twemoji.js' ],
    module.exports = function(grunt) { 
    720719                                src: WORKING_DIR + 'wp-includes/js/imgareaselect/jquery.imgareaselect.js',
    721720                                dest: WORKING_DIR + 'wp-includes/js/imgareaselect/jquery.imgareaselect.min.js'
    722721                        },
     722                        jqueryform: {
     723                                src: WORKING_DIR + 'wp-includes/js/jquery/jquery.form.js',
     724                                dest: WORKING_DIR + 'wp-includes/js/jquery/jquery.form.min.js'
     725                        },
    723726                        dynamic: {
    724727                                expand: true,
    725728                                cwd: WORKING_DIR,
  • deleted file tests/phpunit/tests/dependencies/backbonejs.php

    diff --git a/tests/phpunit/tests/dependencies/backbonejs.php b/tests/phpunit/tests/dependencies/backbonejs.php
    deleted file mode 100644
    index 4c276ad898..0000000000
    + -  
    1 <?php
    2 
    3 /**
    4  * @group dependencies
    5  * @group scripts
    6  */
    7 class Tests_Dependencies_Backbonejs extends WP_UnitTestCase {
    8 
    9         function test_exclusion_of_sourcemaps() {
    10                 $file = ABSPATH . WPINC . '/js/backbone.min.js';
    11                 $this->assertFileExists( $file );
    12                 $contents = trim( file_get_contents( $file ) );
    13                 $this->assertFalse( strpos( $contents, 'sourceMappingURL' ), 'Presence of sourceMappingURL' );
    14         }
    15 }
  • tests/phpunit/tests/dependencies/jquery.php

    diff --git a/tests/phpunit/tests/dependencies/jquery.php b/tests/phpunit/tests/dependencies/jquery.php
    index 8f8bc7e1f0..30ea876e2f 100644
    a b class Tests_Dependencies_jQuery extends WP_UnitTestCase { 
    8282                set_current_screen( 'front' );
    8383        }
    8484
    85         /**
    86          * @ticket 24994
    87          */
    88         function test_exclusion_of_sourcemaps() {
    89                 $contents = trim( file_get_contents( ABSPATH . WPINC . '/js/jquery/jquery.js' ) );
    90                 $this->assertFalse( strpos( $contents, 'sourceMappingURL' ), 'Presence of sourceMappingURL' );
    91         }
    92 
    9385        /**
    9486         * @ticket 28404
    9587         */
  • tests/phpunit/tests/dependencies/scripts.php

    diff --git a/tests/phpunit/tests/dependencies/scripts.php b/tests/phpunit/tests/dependencies/scripts.php
    index b1e8e6c8f8..dd6ca40f31 100644
    a b JS; 
    13411341                        array_keys( $wp_enqueue_code_editor['htmlhint'] )
    13421342                );
    13431343        }
     1344
     1345        function test_no_source_mapping() {
     1346                $all_files = new RecursiveIteratorIterator( new RecursiveDirectoryIterator( dirname( ABSPATH ) . '/build/' ) );
     1347                $js_files  = new RegexIterator( $all_files, '/\.js$/' );
     1348                foreach( $js_files as $js_file ) {
     1349                        $contents = trim( file_get_contents( $js_file ) );
     1350
     1351                        // We allow data: URLs.
     1352                        $found = preg_match( '/sourceMappingURL=((?!data:).)/', $contents );
     1353                        $this->assertSame( $found, 0, "sourceMappingURL found in $js_file" );
     1354                }
     1355        }
    13441356}