Code Duplication    Length = 11-13 lines in 3 locations

tests/core/panel.php 1 location

@@ 200-212 (lines=13) @@
197
	/**
198
	 * @see WP_Customize_Panel::print_template()
199
	 */
200
	function test_print_templates_custom() {
201
		wp_set_current_user( $this->factory->user->create( array( 'role' => 'administrator' ) ) );
202
203
		$panel = new Custom_Panel_Test( $this->manager, 'baz' );
204
		ob_start();
205
		$panel->print_template();
206
		$content = ob_get_clean();
207
		$this->assertContains( '<script type="text/html" id="tmpl-customize-panel-titleless-content">', $content );
208
		$this->assertNotContains( 'accordion-section-title', $content );
209
210
		$this->assertContains( '<script type="text/html" id="tmpl-customize-panel-titleless">', $content );
211
		$this->assertNotContains( 'preview-notice', $content );
212
	}
213
}
214
215
require_once( WP_FIELDS_API_DIR . 'implementation/wp-includes/class-wp-customize-panel.php' );

tests/core/section.php 2 locations

@@ 189-199 (lines=11) @@
186
	/**
187
	 * @see WP_Customize_Section::print_template()
188
	 */
189
	function test_print_templates_standard() {
190
		wp_set_current_user( $this->factory->user->create( array( 'role' => 'administrator' ) ) );
191
192
		$section = new WP_Customize_Section( $this->manager, 'baz' );
193
		ob_start();
194
		$section->print_template();
195
		$content = ob_get_clean();
196
		$this->assertContains( '<script type="text/html" id="tmpl-customize-section-default">', $content );
197
		$this->assertContains( 'accordion-section-title', $content );
198
		$this->assertContains( 'accordion-section-content', $content );
199
	}
200
201
	/**
202
	 * @see WP_Customize_Section::print_template()
@@ 204-214 (lines=11) @@
201
	/**
202
	 * @see WP_Customize_Section::print_template()
203
	 */
204
	function test_print_templates_custom() {
205
		wp_set_current_user( $this->factory->user->create( array( 'role' => 'administrator' ) ) );
206
207
		$section = new Custom_Section_Test( $this->manager, 'baz' );
208
		ob_start();
209
		$section->print_template();
210
		$content = ob_get_clean();
211
		$this->assertContains( '<script type="text/html" id="tmpl-customize-section-titleless">', $content );
212
		$this->assertNotContains( 'accordion-section-title', $content );
213
		$this->assertContains( 'accordion-section-content', $content );
214
	}
215
}
216
217
require_once( WP_FIELDS_API_DIR . 'implementation/wp-includes/class-wp-customize-section.php' );