CRM-18199 Stripping commnt regexp - Style fixed
authorggargani <giovanni@gargani.it>
Fri, 16 Sep 2016 07:17:29 +0000 (09:17 +0200)
committerggargani <giovanni@gargani.it>
Fri, 16 Sep 2016 07:17:29 +0000 (09:17 +0200)
Style fixed

CRM/Utils/File.php
tests/phpunit/CRM/Utils/FileTest.php

index 8c0a0640597fdd0dede97332e3706822728e3ad0..747fb160431711c2ce4c61339304b01380951e37 100644 (file)
@@ -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);
index db2a0a389c5bd5f2b5494167afd2369d3773cb66..ee56e13117a988a1609228448665ca63a994c83f 100644 (file)
@@ -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);