E5D7 fix(params): Allow StoreFile param to be overridden by mijohen · Pull Request #41 · ConvertAPI/convertapi-library-php · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

< 2A9 /file-filter>
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/ConvertApi/Task.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ function __construct($fromFormat, $toFormat, $params, $conversionTimeout = null)

function run()
{
$params = array_merge(
$this->normalizedParams(),
$params = array_replace(
[
'StoreFile' => true,
]
],
$this->normalizedParams()
);

if ($this->conversionTimeout) {
Expand Down
9 changes: 9 additions & 0 deletions tests/ConvertApi/ConvertApiTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,15 @@ public function testConvertWithFilePath()
$this->assertEquals('test.pdf', $result->getFile()->getFileName());
}

public function testConvertWithStoreFileFalse()
{
$params = ['File' => 'examples/files/test.docx', 'StoreFile' => false];

$result = ConvertApi::convert('pdf', $params);

$this->assertEquals('test.pdf', $result->getFile()->getFileName());
}

public function testConvertWithAltnativeConverter()
{
$params = ['File' => 'examples/files/test.docx', 'converter' => 'openoffice'];
Expand Down
0