From 7c389e4895be3e3f281691315cff1ded7f2721fc Mon Sep 17 00:00:00 2001 From: mattyrob Date: Mon, 11 Sep 2023 18:20:16 +0100 Subject: [PATCH] Fix for failing unit test --- tests/phpunit/tests/customize/nav-menus.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/phpunit/tests/customize/nav-menus.php b/tests/phpunit/tests/customize/nav-menus.php index e0c80d1a56..11ba94f284 100644 --- a/tests/phpunit/tests/customize/nav-menus.php +++ b/tests/phpunit/tests/customize/nav-menus.php @@ -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( '#

\s*' . esc_html( $type->labels->name ) . '#', $template ); + $this->assertMatchesRegularExpression( '#\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 ); @@ -780,7 +780,7 @@ 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( '#

\s*' . esc_html( $tax->labels->name ) . '#', $template ); + $this->assertMatchesRegularExpression( '#\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 ); @@ -788,7 +788,7 @@ public function test_available_items_template() { } $this->assertStringContainsString( 'available-menu-items-custom_type', $template ); - $this->assertMatchesRegularExpression( '#

\s*Custom#', $template ); + $this->assertMatchesRegularExpression( '#\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 );