From a9dd611781dcfaddbe099e8443193569f64c3eb7 Mon Sep 17 00:00:00 2001 From: Benjamin Friedman Date: Wed, 29 Nov 2017 01:20:52 -0800 Subject: [PATCH 1/5] Upped parse-server-test to 1.3.5 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 671ba572..d2fa01ef 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,6 @@ "license": "SEE LICENSE IN LICENSE", "homepage": "https://github.com/montymxb/parse-server-test#readme", "dependencies": { - "parse-server-test": "1.3.4" + "parse-server-test": "1.3.5" } } From 794ded50ee3c9f4ed770c25d8f6eb5fd45cfee03 Mon Sep 17 00:00:00 2001 From: Benjamin Friedman Date: Wed, 29 Nov 2017 01:44:44 -0800 Subject: [PATCH 2/5] Fix for parse-server 2.7.0 unknown mime type response --- src/Parse/ParseFile.php | 5 ++++- tests/Parse/ParseFileTest.php | 7 ++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Parse/ParseFile.php b/src/Parse/ParseFile.php index de9a7678..c7fe936f 100755 --- a/src/Parse/ParseFile.php +++ b/src/Parse/ParseFile.php @@ -252,7 +252,10 @@ private function download() if ($httpStatus > 399) { throw new ParseException('Download failed, file may have been deleted.', $httpStatus); } - $this->mimeType = $httpClient->getResponseContentType(); + $mimeType = $httpClient->getResponseContentType(); + if(isset($mimeType) && $mimeType !== 'null') { + $this->mimeType = $mimeType; + } $this->data = $response; return $response; diff --git a/tests/Parse/ParseFileTest.php b/tests/Parse/ParseFileTest.php index fd4926f1..26cfea43 100644 --- a/tests/Parse/ParseFileTest.php +++ b/tests/Parse/ParseFileTest.php @@ -146,7 +146,12 @@ public function testParseFileTypes() $this->assertEquals($contents, $file3Again->getData()); // check mime types after calling getData - $this->assertEquals('application/octet-stream', $fileAgain->getMimeType()); + $mt = $fileAgain->getMimeType(); + $this->assertTrue( + // both of the following are acceptable for a response from a submitted mime type of unknown/unknown + $mt === 'application/octet-stream' || // parse-server < 2.7.0 + $mt === 'unknown/unknown' // parse-server >= 2.7.0, unknown/unknown mime type response change + ); $this->assertEquals('image/png', $file2Again->getMimeType()); $this->assertEquals('image/png', $file3Again->getMimeType()); } From e8a052c48854390950a3bcf76db53a302b48b3bc Mon Sep 17 00:00:00 2001 From: Benjamin Friedman Date: Wed, 29 Nov 2017 01:47:50 -0800 Subject: [PATCH 3/5] HHVM note in readme while making notes --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 456326dd..14e7e708 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ Please note that this documentation contains the latest changes that may as of y ## Installation There are various ways to install and use this sdk. We'll elaborate on a couple here. -Note that the Parse PHP SDK requires PHP 5.4 or newer. +Note that the Parse PHP SDK requires PHP 5.4 or newer. It can also run on **HHVM** (recommended 3.0 or newer). ### Install with Composer From 465eed0db08266165cc8374dae4ec2a758817877 Mon Sep 17 00:00:00 2001 From: Benjamin Friedman Date: Wed, 29 Nov 2017 01:50:50 -0800 Subject: [PATCH 4/5] Not so bold --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 14e7e708..a363fd0a 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ Please note that this documentation contains the latest changes that may as of y ## Installation There are various ways to install and use this sdk. We'll elaborate on a couple here. -Note that the Parse PHP SDK requires PHP 5.4 or newer. It can also run on **HHVM** (recommended 3.0 or newer). +Note that the Parse PHP SDK requires PHP 5.4 or newer. It can also run on HHVM (recommended 3.0 or newer). ### Install with Composer From dbc660e372969071636d98ab0e9fc0affd37cd4d Mon Sep 17 00:00:00 2001 From: Benjamin Friedman Date: Wed, 29 Nov 2017 01:59:40 -0800 Subject: [PATCH 5/5] lint --- src/Parse/ParseFile.php | 2 +- tests/Parse/ParseFileTest.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Parse/ParseFile.php b/src/Parse/ParseFile.php index c7fe936f..39409d04 100755 --- a/src/Parse/ParseFile.php +++ b/src/Parse/ParseFile.php @@ -253,7 +253,7 @@ private function download() throw new ParseException('Download failed, file may have been deleted.', $httpStatus); } $mimeType = $httpClient->getResponseContentType(); - if(isset($mimeType) && $mimeType !== 'null') { + if (isset($mimeType) && $mimeType !== 'null') { $this->mimeType = $mimeType; } $this->data = $response; diff --git a/tests/Parse/ParseFileTest.php b/tests/Parse/ParseFileTest.php index 26cfea43..987a6ffc 100644 --- a/tests/Parse/ParseFileTest.php +++ b/tests/Parse/ParseFileTest.php @@ -147,10 +147,10 @@ public function testParseFileTypes() // check mime types after calling getData $mt = $fileAgain->getMimeType(); + // both of the following are acceptable for a response from a submitted mime type of unknown/unknown $this->assertTrue( - // both of the following are acceptable for a response from a submitted mime type of unknown/unknown $mt === 'application/octet-stream' || // parse-server < 2.7.0 - $mt === 'unknown/unknown' // parse-server >= 2.7.0, unknown/unknown mime type response change + $mt === 'unknown/unknown' // parse-server >= 2.7.0, unknown mime type response change ); $this->assertEquals('image/png', $file2Again->getMimeType()); $this->assertEquals('image/png', $file3Again->getMimeType());