Customizer: Update tests for [34487].

Fixes #33634.

git-svn-id: https://develop.svn.wordpress.org/trunk@34488 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dominik Schilling (ocean90) 2015-09-24 11:31:30 +00:00
parent 15ee0a44b2
commit 1efbe10b47

View File

@ -426,10 +426,10 @@ class Test_WP_Customize_Nav_Menus extends WP_UnitTestCase {
$menus = new WP_Customize_Nav_Menus( $this->wp_customize ); $menus = new WP_Customize_Nav_Menus( $this->wp_customize );
$expected = array( $expected = array(
array( 'title' => 'Post', 'type' => 'post_type', 'object' => 'post' ), array( 'title' => 'Posts', 'type' => 'post_type', 'object' => 'post' ),
array( 'title' => 'Page', 'type' => 'post_type', 'object' => 'page' ), array( 'title' => 'Pages', 'type' => 'post_type', 'object' => 'page' ),
array( 'title' => 'Category', 'type' => 'taxonomy', 'object' => 'category' ), array( 'title' => 'Categories', 'type' => 'taxonomy', 'object' => 'category' ),
array( 'title' => 'Tag', 'type' => 'taxonomy', 'object' => 'post_tag' ), array( 'title' => 'Tags', 'type' => 'taxonomy', 'object' => 'post_tag' ),
); );
if ( current_theme_supports( 'post-formats' ) ) { if ( current_theme_supports( 'post-formats' ) ) {
@ -497,7 +497,7 @@ class Test_WP_Customize_Nav_Menus extends WP_UnitTestCase {
if ( $post_types ) { if ( $post_types ) {
foreach ( $post_types as $type ) { foreach ( $post_types as $type ) {
$this->assertContains( 'available-menu-items-post_type-' . esc_attr( $type->name ), $template ); $this->assertContains( 'available-menu-items-post_type-' . esc_attr( $type->name ), $template );
$this->assertRegExp( '#<h4 class="accordion-section-title".*>\s*' . esc_html( $type->labels->singular_name ) . '#', $template ); $this->assertRegExp( '#<h4 class="accordion-section-title".*>\s*' . esc_html( $type->labels->name ) . '#', $template );
$this->assertContains( 'data-type="post_type"', $template ); $this->assertContains( 'data-type="post_type"', $template );
$this->assertContains( 'data-object="' . esc_attr( $type->name ) . '"', $template ); $this->assertContains( 'data-object="' . esc_attr( $type->name ) . '"', $template );
} }
@ -507,7 +507,7 @@ class Test_WP_Customize_Nav_Menus extends WP_UnitTestCase {
if ( $taxonomies ) { if ( $taxonomies ) {
foreach ( $taxonomies as $tax ) { foreach ( $taxonomies as $tax ) {
$this->assertContains( 'available-menu-items-taxonomy-' . esc_attr( $tax->name ), $template ); $this->assertContains( 'available-menu-items-taxonomy-' . esc_attr( $tax->name ), $template );
$this->assertRegExp( '#<h4 class="accordion-section-title".*>\s*' . esc_html( $tax->labels->singular_name ) . '#', $template ); $this->assertRegExp( '#<h4 class="accordion-section-title".*>\s*' . esc_html( $tax->labels->name ) . '#', $template );
$this->assertContains( 'data-type="taxonomy"', $template ); $this->assertContains( 'data-type="taxonomy"', $template );
$this->assertContains( 'data-object="' . esc_attr( $tax->name ) . '"', $template ); $this->assertContains( 'data-object="' . esc_attr( $tax->name ) . '"', $template );
} }