From: ggargani Date: Fri, 16 Sep 2016 07:17:29 +0000 (+0200) Subject: CRM-18199 Stripping commnt regexp - Style fixed X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=bd6326bf9cd31e26c587a8666aaa5a3fae817715;p=civicrm-core.git CRM-18199 Stripping commnt regexp - Style fixed Style fixed --- 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);