Skip to content
This repository has been archived by the owner on Mar 9, 2024. It is now read-only.

Commit

Permalink
Fix for failing unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
mattyrob committed Sep 11, 2023
1 parent 5315ff7 commit 7c389e4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/phpunit/tests/customize/nav-menus.php
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,7 @@ public function test_available_items_template() {
if ( $post_types ) {
foreach ( $post_types as $type ) {
$this->assertStringContainsString( 'available-menu-items-post_type-' . esc_attr( $type->name ), $template );
$this->assertMatchesRegularExpression( '#<h4 class="accordion-section-title".*>\s*' . esc_html( $type->labels->name ) . '#', $template );
$this->assertMatchesRegularExpression( '#<summary class="accordion-section-title".*>\s*' . esc_html( $type->labels->name ) . '#', $template );
$this->assertStringContainsString( 'data-type="post_type"', $template );
$this->assertStringContainsString( 'data-object="' . esc_attr( $type->name ) . '"', $template );
$this->assertStringContainsString( 'data-type_label="' . esc_attr( $type->labels->singular_name ) . '"', $template );
Expand All @@ -780,15 +780,15 @@ public function test_available_items_template() {
if ( $taxonomies ) {
foreach ( $taxonomies as $tax ) {
$this->assertStringContainsString( 'available-menu-items-taxonomy-' . esc_attr( $tax->name ), $template );
$this->assertMatchesRegularExpression( '#<h4 class="accordion-section-title".*>\s*' . esc_html( $tax->labels->name ) . '#', $template );
$this->assertMatchesRegularExpression( '#<summary class="accordion-section-title".*>\s*' . esc_html( $tax->labels->name ) . '#', $template );
$this->assertStringContainsString( 'data-type="taxonomy"', $template );
$this->assertStringContainsString( 'data-object="' . esc_attr( $tax->name ) . '"', $template );
$this->assertStringContainsString( 'data-type_label="' . esc_attr( $tax->labels->singular_name ) . '"', $template );
}
}

$this->assertStringContainsString( 'available-menu-items-custom_type', $template );
$this->assertMatchesRegularExpression( '#<h4 class="accordion-section-title".*>\s*Custom#', $template );
$this->assertMatchesRegularExpression( '#<summary class="accordion-section-title".*>\s*Custom#', $template );
$this->assertStringContainsString( 'data-type="custom_type"', $template );
$this->assertStringContainsString( 'data-object="custom_object"', $template );
$this->assertStringContainsString( 'data-type_label="Custom Type"', $template );
Expand Down

0 comments on commit 7c389e4

Please sign in to comment.