From 774b2e055d427b52b3bf2e6fa3980bf35ccf4680 Mon Sep 17 00:00:00 2001
From: mattab <matthieu.aubry@gmail.com>
Date: Mon, 22 Sep 2014 15:13:13 +1200
Subject: [PATCH] Fix build by normalising spaces in JSON responses

---
 tests/PHPUnit/Impl/TestRequestResponse.php | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/tests/PHPUnit/Impl/TestRequestResponse.php b/tests/PHPUnit/Impl/TestRequestResponse.php
index 1f4bae3ebb..62a51d38e3 100644
--- a/tests/PHPUnit/Impl/TestRequestResponse.php
+++ b/tests/PHPUnit/Impl/TestRequestResponse.php
@@ -60,7 +60,6 @@ class TestRequestResponse
 
         // Cast as string is important. For example when calling
         // with format=original, objects or php arrays can be returned.
-        // we also hide errors to prevent the 'headers already sent' in the ResponseBuilder (which sends Excel headers multiple times eg.)
         $response = (string) $testRequest->process();
 
         return new TestRequestResponse($response, $params, $requestUrl);
@@ -81,6 +80,10 @@ class TestRequestResponse
 
     private function normalizeApiResponse($apiResponse)
     {
+        if(strpos($this->requestUrl['format'], 'json') === 0) {
+            $apiResponse = str_replace('&nbsp;', '\u00a0', $apiResponse);
+        }
+
         if ($this->shouldDeleteLiveIds()) {
             $apiResponse = $this->removeAllIdsFromXml($apiResponse);
         }
@@ -188,7 +191,7 @@ class TestRequestResponse
             $fieldsToRemove = @$this->params['xmlFieldsToRemove'];
         }
 
-        $fieldsToRemove[] = 'idsubdatatable'; // TODO: had testNotSmallAfter, should still?
+        $fieldsToRemove[] = 'idsubdatatable';
 
         foreach ($fieldsToRemove as $xml) {
             $input = $this->removeXmlElement($input, $xml);
-- 
GitLab