From bd6326bf9cd31e26c587a8666aaa5a3fae817715 Mon Sep 17 00:00:00 2001 From: ggargani Date: Fri, 16 Sep 2016 09:17:29 +0200 Subject: [PATCH] CRM-18199 Stripping commnt regexp - Style fixed Style fixed --- CRM/Utils/File.php | 2 +- tests/phpunit/CRM/Utils/FileTest.php | 24 ++++++++++++------------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/CRM/Utils/File.php b/CRM/Utils/File.php index 8c0a064059..747fb16043 100644 --- a/CRM/Utils/File.php +++ b/CRM/Utils/File.php @@ -350,7 +350,7 @@ class CRM_Utils_File { * @param string $string * * @return string - * stripped string + * stripped string */ public static function stripComments($string) { return preg_replace("/^(#|--).*\R*/m", "", $string); diff --git a/tests/phpunit/CRM/Utils/FileTest.php b/tests/phpunit/CRM/Utils/FileTest.php index db2a0a389c..ee56e13117 100644 --- a/tests/phpunit/CRM/Utils/FileTest.php +++ b/tests/phpunit/CRM/Utils/FileTest.php @@ -25,18 +25,18 @@ class CRM_Utils_FileTest extends CiviUnitTestCase { } public function testStripComment() { $strings = array( - "\nab\n-- cd\nef"=>"\nab\nef", - "ab\n-- cd\nef"=>"ab\nef", - "ab\n-- cd\nef\ngh"=>"ab\nef\ngh", - "ab\n--cd\nef"=>"ab\nef", - "ab\n--cd\nef\n"=>"ab\nef\n", - "ab\n#cd\nef\n"=>"ab\nef\n", - "ab\n--cd\nef"=>"ab\nef", - "ab\n#cd\nef"=>"ab\nef", - "ab\nfoo#cd\nef"=>"ab\nfoo#cd\nef", - "ab\r\n--cd\r\nef"=>"ab\r\nef", - "ab\r\n#cd\r\nef"=>"ab\r\nef", - "ab\r\nfoo#cd\r\nef"=>"ab\r\nfoo#cd\r\nef", + "\nab\n-- cd\nef" => "\nab\nef", + "ab\n-- cd\nef" => "ab\nef", + "ab\n-- cd\nef\ngh" => "ab\nef\ngh", + "ab\n--cd\nef" => "ab\nef", + "ab\n--cd\nef\n" => "ab\nef\n", + "ab\n#cd\nef\n" => "ab\nef\n", + "ab\n--cd\nef" => "ab\nef", + "ab\n#cd\nef" => "ab\nef", + "ab\nfoo#cd\nef" => "ab\nfoo#cd\nef", + "ab\r\n--cd\r\nef" => "ab\r\nef", + "ab\r\n#cd\r\nef" => "ab\r\nef", + "ab\r\nfoo#cd\r\nef" => "ab\r\nfoo#cd\r\nef", ); foreach ($strings as $string => $check) { $test=CRM_Utils_File::stripComments($string); -- 2.25.1