Skip to content

Commit a4c67b1

Browse files
authored
fix(params): Allow StoreFile param to be overridden (#41)
1 parent 86de9d0 commit a4c67b1

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

lib/ConvertApi/Task.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ function __construct($fromFormat, $toFormat, $params, $conversionTimeout = null)
2121

2222
function run()
2323
{
24-
$params = array_merge(
25-
$this->normalizedParams(),
24+
$params = array_replace(
2625
[
2726
'StoreFile' => true,
28-
]
27+
],
28+
$this->normalizedParams()
2929
);
3030

3131
if ($this->conversionTimeout) {

tests/ConvertApi/ConvertApiTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,15 @@ public function testConvertWithFilePath()
7777
$this->assertEquals('test.pdf', $result->getFile()->getFileName());
7878
}
7979

80+
public function testConvertWithStoreFileFalse()
81+
{
82+
$params = ['File' => 'examples/files/test.docx', 'StoreFile' => false];
83+
84+
$result = ConvertApi::convert('pdf', $params);
85+
86+
$this->assertEquals('test.pdf', $result->getFile()->getFileName());
87+
}
88+
8089
public function testConvertWithAltnativeConverter()
8190
{
8291
$params = ['File' => 'examples/files/test.docx', 'converter' => 'openoffice'];

0 commit comments

Comments
 (0)