Changeset 48937 for trunk/tests/phpunit/tests/customize/partial.php
- Timestamp:
- 09/02/2020 12:35:36 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/customize/partial.php
r47198 r48937 48 48 $partial_id = 'blogname'; 49 49 $partial = new WP_Customize_Partial( $this->selective_refresh, $partial_id ); 50 $this->assert Equals( $partial_id, $partial->id );51 $this->assert Equals( $this->selective_refresh, $partial->component );52 $this->assert Equals( 'default', $partial->type );50 $this->assertSame( $partial_id, $partial->id ); 51 $this->assertSame( $this->selective_refresh, $partial->component ); 52 $this->assertSame( 'default', $partial->type ); 53 53 $this->assertEmpty( $partial->selector ); 54 $this->assert Equals( array( $partial_id ), $partial->settings );55 $this->assert Equals( $partial_id, $partial->primary_setting );56 $this->assert Equals( array( $partial, 'render_callback' ), $partial->render_callback );57 $this->assert Equals( false,$partial->container_inclusive );58 $this->assert Equals( true,$partial->fallback_refresh );54 $this->assertSame( array( $partial_id ), $partial->settings ); 55 $this->assertSame( $partial_id, $partial->primary_setting ); 56 $this->assertSame( array( $partial, 'render_callback' ), $partial->render_callback ); 57 $this->assertFalse( $partial->container_inclusive ); 58 $this->assertTrue( $partial->fallback_refresh ); 59 59 } 60 60 … … 103 103 ); 104 104 $partial = new WP_Customize_Partial( $this->selective_refresh, $partial_id, $args ); 105 $this->assert Equals( $partial_id, $partial->id );106 $this->assert Equals( $this->selective_refresh, $partial->component );107 $this->assert Equals( $args['type'], $partial->type );108 $this->assert Equals( $args['selector'], $partial->selector );105 $this->assertSame( $partial_id, $partial->id ); 106 $this->assertSame( $this->selective_refresh, $partial->component ); 107 $this->assertSame( $args['type'], $partial->type ); 108 $this->assertSame( $args['selector'], $partial->selector ); 109 109 $this->assertEqualSets( $args['settings'], $partial->settings ); 110 $this->assert Equals( $args['primary_setting'], $partial->primary_setting );111 $this->assert Equals( $args['render_callback'], $partial->render_callback );112 $this->assert Equals( false,$partial->container_inclusive );113 $this->assert Equals( false,$partial->fallback_refresh );110 $this->assertSame( $args['primary_setting'], $partial->primary_setting ); 111 $this->assertSame( $args['render_callback'], $partial->render_callback ); 112 $this->assertFalse( $partial->container_inclusive ); 113 $this->assertFalse( $partial->fallback_refresh ); 114 114 $this->assertContains( 'Lorem Ipsum', $partial->render() ); 115 115 … … 121 121 ) 122 122 ); 123 $this->assert Equals( array( 'blogdescription' ), $partial->settings );124 $this->assert Equals( 'blogdescription', $partial->primary_setting );123 $this->assertSame( array( 'blogdescription' ), $partial->settings ); 124 $this->assertSame( 'blogdescription', $partial->primary_setting ); 125 125 } 126 126 … … 133 133 $partial = new WP_Customize_Partial( $this->selective_refresh, 'foo' ); 134 134 $id_data = $partial->id_data(); 135 $this->assert Equals( 'foo', $id_data['base'] );136 $this->assert Equals( array(), $id_data['keys'] );135 $this->assertSame( 'foo', $id_data['base'] ); 136 $this->assertSame( array(), $id_data['keys'] ); 137 137 138 138 $partial = new WP_Customize_Partial( $this->selective_refresh, 'bar[baz][quux]' ); 139 139 $id_data = $partial->id_data(); 140 $this->assert Equals( 'bar', $id_data['base'] );141 $this->assert Equals( array( 'baz', 'quux' ), $id_data['keys'] );140 $this->assertSame( 'bar', $id_data['base'] ); 141 $this->assertSame( array( 'baz', 'quux' ), $id_data['keys'] ); 142 142 } 143 143 … … 181 181 */ 182 182 function filter_customize_partial_render_with_id( $rendered, $partial, $container_context ) { 183 $this->assert Equals( sprintf( 'customize_partial_render_%s', $partial->id ), current_filter() );183 $this->assertSame( sprintf( 'customize_partial_render_%s', $partial->id ), current_filter() ); 184 184 $this->assertTrue( false === $rendered || is_string( $rendered ) ); 185 185 $this->assertInstanceOf( 'WP_Customize_Partial', $partial ); … … 250 250 add_filter( "customize_partial_render_{$partial->id}", array( $this, 'filter_customize_partial_render_with_id' ), 10, 3 ); 251 251 $rendered = $partial->render(); 252 $this->assert Equals( 'foo', $rendered );253 $this->assert Equals( $count_filter_customize_partial_render + 1, $this->count_filter_customize_partial_render );254 $this->assert Equals( $count_filter_customize_partial_render_with_id + 1, $this->count_filter_customize_partial_render_with_id );252 $this->assertSame( 'foo', $rendered ); 253 $this->assertSame( $count_filter_customize_partial_render + 1, $this->count_filter_customize_partial_render ); 254 $this->assertSame( $count_filter_customize_partial_render_with_id + 1, $this->count_filter_customize_partial_render_with_id ); 255 255 } 256 256 … … 273 273 add_filter( "customize_partial_render_{$partial->id}", array( $this, 'filter_customize_partial_render_with_id' ), 10, 3 ); 274 274 $rendered = $partial->render(); 275 $this->assert Equals( 'bar', $rendered );276 $this->assert Equals( $count_filter_customize_partial_render + 1, $this->count_filter_customize_partial_render );277 $this->assert Equals( $count_filter_customize_partial_render_with_id + 1, $this->count_filter_customize_partial_render_with_id );275 $this->assertSame( 'bar', $rendered ); 276 $this->assertSame( $count_filter_customize_partial_render + 1, $this->count_filter_customize_partial_render ); 277 $this->assertSame( $count_filter_customize_partial_render_with_id + 1, $this->count_filter_customize_partial_render_with_id ); 278 278 } 279 279
Note: See TracChangeset
for help on using the changeset viewer.