Changeset 1115 in tests for trunk/tests/dependencies/scripts.php
- Timestamp:
- 11/06/2012 09:35:35 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/dependencies/scripts.php
r909 r1115 9 9 function setUp() { 10 10 parent::setUp(); 11 $this->old_wp_scripts = $GLOBALS['wp_scripts'];11 $this->old_wp_scripts = isset( $GLOBALS['wp_scripts'] ) ? $GLOBALS['wp_scripts'] : null; 12 12 remove_action( 'wp_default_scripts', 'wp_default_scripts' ); 13 13 $GLOBALS['wp_scripts'] = new WP_Scripts(); … … 85 85 $wp_scripts->base_url = $base_url_backup; 86 86 } 87 88 /** 89 * @ticket 22229 90 */ 91 function test_inline_should_not_output_script_tag_with_src() { 92 wp_enqueue_script( 'baba-inline-0', 'inline' ); 93 $this->assertEquals( '', get_echo( 'wp_print_scripts' ) ); 94 } 95 96 /** 97 * @ticket 22229 98 */ 99 function test_json_encode_should_not_encode_special_literal_values() { 100 $literal = new WP_JS_Literal( 'baba()' ); 101 $this->assertEquals( '{"x":baba()}', WP_JS_Literal::json_encode( array( 'x' => $literal ), array( $literal ) ) ); 102 } 103 104 /** 105 * @ticket 22229 106 */ 107 function test_json_encode_should_not_encode_special_literal_values_with_dependencies() { 108 $literal = new WP_JS_Literal( 'baba()', array( 'dep0', 'dep1' ) ); 109 $this->assertEquals( '{"x":baba()}', WP_JS_Literal::json_encode( array( 'x' => $literal ), array( $literal ) ) ); 110 } 87 111 }
Note: See TracChangeset
for help on using the changeset viewer.