mirror of
https://github.com/SociallyDev/Spaces-API.git
synced 2025-07-05 12:36:01 -07:00
Added extra test assertion for Space::uploadFile
mimeType argument
Added extra parameters for `Space::uploadFile` to docs
This commit is contained in:
parent
f1adeb7c07
commit
de48ddb481
2 changed files with 6 additions and 1 deletions
|
@ -463,7 +463,7 @@ Recursively upload an entire directory
|
|||
**Description**
|
||||
|
||||
```php
|
||||
public uploadFile (string $filepath, string|null $filename = null)
|
||||
public uploadFile (string $filepath, string|null $filename = null, string|null $mimeType = null, bool $private = true)
|
||||
```
|
||||
|
||||
Upload a file
|
||||
|
@ -476,6 +476,10 @@ Upload a file
|
|||
: The path to the file, including the filename. Relative and absolute paths are accepted.
|
||||
* `(string|null) $filename`
|
||||
: The remote filename. If `null`, the local filename will be used. Default `null`
|
||||
* `(string|null) $mimeType`
|
||||
: The files mimeType. If `null` the mimeType is inferred from the file by DigitalOcean Spaces. Default `null`
|
||||
* `(bool)` $private
|
||||
: If `true` then the file is private, if `false` the file is publicly available. Default `true`
|
||||
|
||||
**Return Values**
|
||||
|
||||
|
|
|
@ -91,6 +91,7 @@ class SpaceTest extends TestCase
|
|||
$tmpFile = tempnam(sys_get_temp_dir(), 'spaces-test');
|
||||
$file = self::$space->uploadFile($tmpFile, 'upload-test.txt', 'text/plain');
|
||||
$this->assertInstanceOf(File::class, $file);
|
||||
$this->assertEquals('text/plain', $file->content_type);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue