From 4277df991da0d85b7ba1124cce6fe4bf424d56f6 Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Thu, 28 Sep 2017 22:55:54 +0000 Subject: [PATCH] Build/Test tools: Update some test cases in anticipation of code formatting corrections. These two tests assume a certain level of indentation in code which does not conform to core's coding standards and will hopefully be corrected at some point in #41057. See #41057 git-svn-id: https://develop.svn.wordpress.org/trunk@41635 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/pluggable.php | 2 +- tests/phpunit/tests/user/capabilities.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/phpunit/tests/pluggable.php b/tests/phpunit/tests/pluggable.php index 82c6ab16e8..276c021f70 100644 --- a/tests/phpunit/tests/pluggable.php +++ b/tests/phpunit/tests/pluggable.php @@ -102,7 +102,7 @@ class Tests_Pluggable extends WP_UnitTestCase { } foreach ( $test_files as $file ) { - preg_match_all( '#^function (\w+)#m', file_get_contents( ABSPATH . '/' . $file ), $functions ); + preg_match_all( '#^\t?function (\w+)#m', file_get_contents( ABSPATH . '/' . $file ), $functions ); foreach ( $functions[1] as $function ) { $data[] = array( diff --git a/tests/phpunit/tests/user/capabilities.php b/tests/phpunit/tests/user/capabilities.php index 7e588c3c23..317553a25d 100644 --- a/tests/phpunit/tests/user/capabilities.php +++ b/tests/phpunit/tests/user/capabilities.php @@ -401,7 +401,7 @@ class Tests_User_Capabilities extends WP_UnitTestCase { $this->assertSame( 1, $matched ); $this->assertNotEmpty( $function ); - $matched = preg_match_all( '/^[\t]case \'([^\']+)/m', $function[0], $cases ); + $matched = preg_match_all( '/^[\t]{1,2}case \'([^\']+)/m', $function[0], $cases ); $this->assertNotEmpty( $matched ); $this->assertNotEmpty( $cases );