Changeset 51968 for trunk/tests/phpunit/tests/dependencies/scripts.php
- Timestamp:
- 11/01/2021 10:22:49 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/dependencies/scripts.php
r51576 r51968 721 721 $wp_scripts->base_url = ''; 722 722 $wp_scripts->do_concat = true; 723 724 if ( PHP_VERSION_ID >= 80100 ) { 725 /* 726 * For the time being, ignoring PHP 8.1 "null to non-nullable" deprecations coming in 727 * via hooked in filter functions until a more structural solution to the 728 * "missing input validation" conundrum has been architected and implemented. 729 */ 730 $this->expectDeprecation(); 731 $this->expectDeprecationMessageMatches( '`Passing null to parameter \#[0-9]+ \(\$[^\)]+\) of type [^ ]+ is deprecated`' ); 732 } 723 733 724 734 $ver = get_bloginfo( 'version' ); … … 747 757 wp_add_inline_script( 'test-example2', 'console.log("after");', 'after' ); 748 758 749 $print_scripts = get_echo( 'wp_print_scripts' ); 750 $print_scripts .= get_echo( '_print_scripts' ); 759 // Effectively ignore the output until retrieving it later via `getActualOutput()`. 760 $this->expectOutputRegex( '`.`' ); 761 762 wp_print_scripts(); 763 _print_scripts(); 764 $print_scripts = $this->getActualOutput(); 751 765 752 766 /* … … 777 791 $wp_scripts->do_concat = true; 778 792 793 if ( PHP_VERSION_ID >= 80100 ) { 794 /* 795 * For the time being, ignoring PHP 8.1 "null to non-nullable" deprecations coming in 796 * via hooked in filter functions until a more structural solution to the 797 * "missing input validation" conundrum has been architected and implemented. 798 */ 799 $this->expectDeprecation(); 800 $this->expectDeprecationMessageMatches( '`Passing null to parameter \#[0-9]+ \(\$[^\)]+\) of type [^ ]+ is deprecated`' ); 801 } 802 779 803 $expected_tail = "<script type='text/javascript' src='/customize-dependency.js' id='customize-dependency-js'></script>\n"; 780 804 $expected_tail .= "<script type='text/javascript' id='customize-dependency-js-after'>\n"; … … 786 810 wp_add_inline_script( $handle, 'tryCustomizeDependency()' ); 787 811 788 $print_scripts = get_echo( 'wp_print_scripts' ); 789 $print_scripts .= get_echo( '_print_scripts' ); 812 // Effectively ignore the output until retrieving it later via `getActualOutput()`. 813 $this->expectOutputRegex( '`.`' ); 814 815 wp_print_scripts(); 816 _print_scripts(); 817 $print_scripts = $this->getActualOutput(); 790 818 791 819 $tail = substr( $print_scripts, strrpos( $print_scripts, "<script type='text/javascript' src='/customize-dependency.js' id='customize-dependency-js'>" ) );
Note: See TracChangeset
for help on using the changeset viewer.