Changeset 52010 for trunk/tests/phpunit/tests/customize/partial.php
- Timestamp:
- 11/04/2021 03:22:47 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/customize/partial.php
r51568 r52010 30 30 * Set up. 31 31 */ 32 function set_up() {32 public function set_up() { 33 33 parent::set_up(); 34 34 require_once ABSPATH . WPINC . '/class-wp-customize-manager.php'; … … 45 45 * @see WP_Customize_Partial::__construct() 46 46 */ 47 function test_construct_default_args() {47 public function test_construct_default_args() { 48 48 $partial_id = 'blogname'; 49 49 $partial = new WP_Customize_Partial( $this->selective_refresh, $partial_id ); … … 65 65 * @return string|false Content or false if error. 66 66 */ 67 function render_post_content_partial( $partial ) {67 public function render_post_content_partial( $partial ) { 68 68 $id_data = $partial->id_data(); 69 69 $post_id = (int) $id_data['keys'][0]; … … 83 83 * @see WP_Customize_Partial::__construct() 84 84 */ 85 function test_construct_non_default_args() {85 public function test_construct_non_default_args() { 86 86 87 87 $post_id = self::factory()->post->create( … … 130 130 * @see WP_Customize_Partial::id_data() 131 131 */ 132 function test_id_data() {132 public function test_id_data() { 133 133 $partial = new WP_Customize_Partial( $this->selective_refresh, 'foo' ); 134 134 $id_data = $partial->id_data(); … … 164 164 * @return string|false Content. 165 165 */ 166 function filter_customize_partial_render( $rendered, $partial, $container_context ) {166 public function filter_customize_partial_render( $rendered, $partial, $container_context ) { 167 167 $this->assertTrue( false === $rendered || is_string( $rendered ) ); 168 168 $this->assertInstanceOf( 'WP_Customize_Partial', $partial ); … … 180 180 * @return string|false Content. 181 181 */ 182 function filter_customize_partial_render_with_id( $rendered, $partial, $container_context ) {182 public function filter_customize_partial_render_with_id( $rendered, $partial, $container_context ) { 183 183 $this->assertSame( sprintf( 'customize_partial_render_%s', $partial->id ), current_filter() ); 184 184 $this->assertTrue( false === $rendered || is_string( $rendered ) ); … … 194 194 * @return string Content. 195 195 */ 196 function render_echo_and_return() {196 public function render_echo_and_return() { 197 197 echo 'foo'; 198 198 return 'bar'; … … 202 202 * Echo render_callback(). 203 203 */ 204 function render_echo() {204 public function render_echo() { 205 205 echo 'foo'; 206 206 } … … 211 211 * @return string Content. 212 212 */ 213 function render_return() {213 public function render_return() { 214 214 return 'bar'; 215 215 } … … 220 220 * @see WP_Customize_Partial::render() 221 221 */ 222 function test_render_with_bad_callback_should_give_preference_to_return_value() {222 public function test_render_with_bad_callback_should_give_preference_to_return_value() { 223 223 $partial = new WP_Customize_Partial( 224 224 $this->selective_refresh, … … 237 237 * @see WP_Customize_Partial::render() 238 238 */ 239 function test_render_echo_callback() {239 public function test_render_echo_callback() { 240 240 $partial = new WP_Customize_Partial( 241 241 $this->selective_refresh, … … 260 260 * @see WP_Customize_Partial::render() 261 261 */ 262 function test_render_return_callback() {262 public function test_render_return_callback() { 263 263 $partial = new WP_Customize_Partial( 264 264 $this->selective_refresh, … … 283 283 * @see WP_Customize_Partial::render_callback() 284 284 */ 285 function test_render_callback_default() {285 public function test_render_callback_default() { 286 286 $partial = new WP_Customize_Partial( $this->selective_refresh, 'foo' ); 287 287 $this->assertFalse( $partial->render_callback( $partial, array() ) ); … … 294 294 * @see WP_Customize_Partial::json() 295 295 */ 296 function test_json() {296 public function test_json() { 297 297 $post_id = 123; 298 298 $partial_id = sprintf( 'post_content[%d]', $post_id ); … … 322 322 * @see WP_Customize_Partial::check_capabilities() 323 323 */ 324 function test_check_capabilities() {324 public function test_check_capabilities() { 325 325 wp_set_current_user( self::factory()->user->create( array( 'role' => 'administrator' ) ) ); 326 326 do_action( 'customize_register', $this->wp_customize ); … … 391 391 * Tear down. 392 392 */ 393 function tear_down() {393 public function tear_down() { 394 394 $this->wp_customize = null; 395 395 unset( $GLOBALS['wp_customize'] );
Note: See TracChangeset
for help on using the changeset viewer.