[mapguide-commits] r8163 - trunk/MgDev/UnitTest/WebTier/Php

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Mon May 26 09:57:09 PDT 2014


Author: jng
Date: 2014-05-26 09:57:09 -0700 (Mon, 26 May 2014)
New Revision: 8163

Modified:
   trunk/MgDev/UnitTest/WebTier/Php/Validate.php
Log:
Apply same line ending normalization before comparing string results to the PHP test runner

Modified: trunk/MgDev/UnitTest/WebTier/Php/Validate.php
===================================================================
--- trunk/MgDev/UnitTest/WebTier/Php/Validate.php	2014-05-26 16:24:24 UTC (rev 8162)
+++ trunk/MgDev/UnitTest/WebTier/Php/Validate.php	2014-05-26 16:57:09 UTC (rev 8163)
@@ -138,8 +138,12 @@
 
                     if ($_POST['testExecutionMode'] == "validate")
                     {
+                        //Normalize line endings so comparisons don't fall over due to incorrect line endings when expected results were entered in SQLite GUI
+                        $normResultData = str_replace("\r\n", "\n", $resultData);
+                        $normExpectedResult = str_replace("\r\n", "\n", $expectedResult);
+                    
                         //If the results are different and special validation fails then the operation failed ->mark it red
-                        if (strncasecmp($resultData, $expectedResult, strlen($resultData . $expectedResult)) && !(ValidateUtils::SpecialValidation($operation, $resultData, $expectedResult)))
+                        if (strncasecmp($normResultData, $normExpectedResult, strlen($normResultData . $normExpectedResult)) && !(ValidateUtils::SpecialValidation($operation, $resultData, $expectedResult)))
                         {
                             $outcome="fail";
                             $exitStatus=1;



More information about the mapguide-commits mailing list