Skip to content

Commit

Permalink
test windows, macos
Browse files Browse the repository at this point in the history
  • Loading branch information
recca0120 committed May 2, 2023
1 parent 492afe7 commit 1d4120e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ jobs:
strategy:
fail-fast: true
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
php: [ '7.3', '7.4', '8.0', '8.1', '8.2' ]

name: PHP ${{ matrix.php }}
name: ${{ matrix.os }} PHP ${{ matrix.php }}
env:
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, grpc
key: cache-v1 # can be any string, change to clear the extension cache.
Expand Down
4 changes: 2 additions & 2 deletions src/FileAPI.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ protected function isCompleted(string $name): bool
protected function receiveChunked(string $name): UploadedFile
{
$contentDisposition = (string) $this->request->header('content-disposition');
[$start, $end] = $this->parseContentRange();
[$start, $end, $total] = $this->parseContentRange();
$originalName = $this->parseOriginalName($contentDisposition);
$mimeType = $this->request->header('content-type');
$uuid = $this->request->get('token');
$uuid = $this->request->get('token') ?? md5($originalName.$total);

$chunkFile = $this->createChunkFile($originalName, $uuid, $mimeType);
$chunkFile->appendStream($this->request->getContent(true), $start);
Expand Down
2 changes: 1 addition & 1 deletion tests/ReceiverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function testReceive(): void
$path = 'temp';
$domain = 'https://foo.bar/';

$uploadedFile = UploadedFile::fake()->create('test.php');
$uploadedFile = UploadedFile::fake()->create('中文.php');

$api = m::spy(Api::class);
$api->allows('path')->andReturn($path);
Expand Down

0 comments on commit 1d4120e

Please sign in to comment.