Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add extra extenstions #73

Merged
merged 1 commit into from
Feb 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions classes/converter.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,21 @@ class converter implements \core_files\converter_interface {
private static $imports = [
'doc' => 'application/msword',
'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template',
'rtf' => 'application/rtf',
'xls' => 'application/vnd.ms-excel',
'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
'pot' => 'application/vnd.ms-powerpoint',
'ppt' => 'application/vnd.ms-powerpoint',
'pptx' => 'application/vnd.ms-powerpoint',
'html' => 'text/html',
'odt' => 'application/vnd.oasis.opendocument.text',
'ods' => 'application/vnd.oasis.opendocument.spreadsheet',
'png' => 'image/png',
'jpeg' => 'image/jpeg',
'jpg' => 'image/jpeg',
'txt' => 'text/plain',
'csv' => 'text/csv',
'gif' => 'image/gif',
];

Expand Down
10 changes: 8 additions & 2 deletions tests/converter_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -549,25 +549,31 @@ public function test_conversion_record_deduplication() {

/**
* Data provider for test_supports
* Supported formats: 'doc', 'docx', 'rtf', 'xls', 'xlsx', 'ppt', 'pptx', 'html', 'odt',
* 'ods', 'txt', 'png', 'jpg', 'gif', 'pdf'
*
* @return array
*/
public function supports_provider() {
return [
['doc', true], ['DOC', true],
['docm', false], ['DOCM', false],
['docx', true], ['DOCX', true],
['dotx', true], ['DOTX', true],
['rtf', true], ['RTF', true],
['xls', true], ['XLS', true],
['xlsm', false], ['XLSM', false],
['xlsx', true], ['XLSX', true],
['xltm', false], ['XLTM', false],
['pot', true], ['POT', true],
['ppt', true], ['PPT', true],
['pptm', false], ['PPTM', false],
['pptx', true], ['PPTX', true],
['html', true], ['HTML', true],
['odt', true], ['ODT', true],
['ods', true], ['ODS', true],
['txt', true], ['TXT', true],
['csv', true], ['CSV', true],
['png', true], ['PNG', true],
['jpeg', true], ['JPEG', true],
['jpg', true], ['JPG', true],
['gif', true], ['GIF', true],
['pdf', false], ['PDF', false],
Expand Down
Loading