Skip to content

Commit

Permalink
fix for export API
Browse files Browse the repository at this point in the history
  • Loading branch information
zopyx committed Nov 9, 2017
1 parent d671e0f commit 50410e0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions api.php
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,7 @@ function export_document($documentId, $user_id, $format, $template_id = '', $set
$url = $this->partner_url . '/partner/documents/' . $documentId . '/export/sdxml';
} elseif ($format == 'html') {
$url = $this->partner_url . '/partner/documents/' . $documentId . '/export/html';
$data['mode'] = 'final';
} elseif ($format == 'docx') {
$url = $this->partner_url . '/partner/documents/' . $documentId . '/export/word';
$data['templateId'] = $template_id;
Expand Down
6 changes: 3 additions & 3 deletions testsuite.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,21 +119,21 @@ function testExportDOCX()
$templates = $this->sd->list_templates();
$template_id = get_object_vars($templates[0])['id'];
$documentId = $this->_createDocument();
$fn = $this->sd->export_document($documentId, 'ajung', 'docx', $template_id);
$fn = $this->sd->export_document($documentId, 'testuser', 'docx', $template_id);
$this->assertEquals(true, endsWith($fn, '.docx'));
}

function testExportSDXML()
{
$documentId = $this->_createDocument();
$fn = $this->sd->export_document($documentId, 'ajung', 'sdxml');
$fn = $this->sd->export_document($documentId, 'testuser', 'sdxml');
$this->assertEquals(true, endsWith($fn, '.sdxml.zip'));
}

function testExportHTML()
{
$documentId = $this->_createDocument();
$fn = $this->sd->export_document($documentId, 'ajung', 'html');
$fn = $this->sd->export_document($documentId, 'testuser', 'html');
$this->assertEquals(true, endsWith($fn, '.html.zip'));
}

Expand Down

0 comments on commit 50410e0

Please sign in to comment.