Added extra test assertion for Space::uploadFile mimeType argument

Added extra parameters for `Space::uploadFile` to docs
This commit is contained in:
David Wakelin 2022-03-30 11:21:42 +01:00
parent f1adeb7c07
commit de48ddb481
2 changed files with 6 additions and 1 deletions

View file

@ -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**

View file

@ -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);
}
/**