Skip to content

Update parse-server-test to 1.3.5 #379

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Nov 29, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
5 changes: 4 additions & 1 deletion src/Parse/ParseFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
7 changes: 6 additions & 1 deletion tests/Parse/ParseFileTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
// both of the following are acceptable for a response from a submitted mime type of unknown/unknown
$this->assertTrue(
$mt === 'application/octet-stream' || // parse-server < 2.7.0
$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());
}
Expand Down