From 3ba7fef5c424159b1fe6e5227fc62d5d70366d3c Mon Sep 17 00:00:00 2001
From: Volker Krause <vkrause@kde.org>
Date: Sun, 18 Dec 2016 12:27:28 +0100
Subject: [PATCH] Fix HTTP response content type tests with newer PHP5 versions

---
 tests/auto/productapitest.cpp | 2 +-
 tests/auto/providertest.cpp   | 2 +-
 tests/auto/surveyapitest.cpp  | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/auto/productapitest.cpp b/tests/auto/productapitest.cpp
index a466868..dd0fa0f 100644
--- a/tests/auto/productapitest.cpp
+++ b/tests/auto/productapitest.cpp
@@ -100,7 +100,7 @@ private slots:
         reply = RESTApi::listProducts(&client);
         QVERIFY(waitForFinished(reply));
         QCOMPARE(reply->error(), QNetworkReply::NoError);
-        QCOMPARE(reply->header(QNetworkRequest::ContentTypeHeader).toString(), QLatin1String("text/json"));
+        QVERIFY(reply->header(QNetworkRequest::ContentTypeHeader).toString().startsWith(QLatin1String("text/json")));
         const auto products = Product::fromJson(reply->readAll());
         QVERIFY(!findProduct(products, QLatin1String("org.kde.UserFeedback.UnitTestProduct")).isValid());
 
diff --git a/tests/auto/providertest.cpp b/tests/auto/providertest.cpp
index 4b7c17e..756e1ce 100644
--- a/tests/auto/providertest.cpp
+++ b/tests/auto/providertest.cpp
@@ -101,7 +101,7 @@ private slots:
         // retrieve data
         reply = RESTApi::listSamples(&client, p);
         QVERIFY(waitForFinished(reply));
-        QCOMPARE(reply->header(QNetworkRequest::ContentTypeHeader).toString(), QLatin1String("text/json"));
+        QVERIFY(reply->header(QNetworkRequest::ContentTypeHeader).toString().startsWith(QLatin1String("text/json")));
         auto doc = QJsonDocument::fromJson(reply->readAll());
         QVERIFY(doc.isArray());
         auto a = doc.array();
diff --git a/tests/auto/surveyapitest.cpp b/tests/auto/surveyapitest.cpp
index 96d6e92..edd8929 100644
--- a/tests/auto/surveyapitest.cpp
+++ b/tests/auto/surveyapitest.cpp
@@ -94,7 +94,7 @@ private slots:
         auto reply = RESTApi::listSurveys(&client, p);
         QVERIFY(waitForFinished(reply));
         QCOMPARE(reply->error(), QNetworkReply::NoError);
-        QCOMPARE(reply->header(QNetworkRequest::ContentTypeHeader).toString(), QLatin1String("text/json"));
+        QVERIFY(reply->header(QNetworkRequest::ContentTypeHeader).toString().startsWith(QLatin1String("text/json")));
         auto surveys = Survey::fromJson(reply->readAll());
         QVERIFY(surveys.isEmpty());
 
-- 
GitLab