Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
integration
prechecker
Commits
ac1c66a0
Commit
ac1c66a0
authored
Mar 15, 2017
by
Andrew Nicols
Browse files
MDL-55528 fileconverter_unoconv: Unit test correction
parent
7f2d58bf
Changes
1
Hide whitespace changes
Inline
Side-by-side
files/converter/unoconv/tests/converter_test.php
View file @
ac1c66a0
...
...
@@ -83,21 +83,18 @@ class fileconverter_unoconv_converter_testcase extends advanced_testcase {
$testfile
=
$fs
->
create_file_from_pathname
(
$filerecord
,
$source
);
$converter
=
$this
->
get_testable_mock
();
$conversion
=
new
\
core_files\conversion
(
0
,
(
object
)
[
'targetformat'
=>
'pdf'
,
]);
$conversion
->
set_sourcefile
(
$testfile
);
$conversion
->
create
();
// Convert the document.
$result
=
$converter
->
start_document_conversion
(
$testfile
,
'pdf'
);
$converter
->
start_document_conversion
(
$conversion
);
$result
=
$conversion
->
get_destfile
();
$this
->
assertNotFalse
(
$result
);
$this
->
assertSame
(
'application/pdf'
,
$result
->
get_mimetype
());
$this
->
assertGreaterThan
(
0
,
$result
->
get_filesize
());
// Repeat immediately with the file forcing re-generation.
$new
=
$converter
->
start_document_conversion
(
$testfile
,
'pdf'
,
true
);
$this
->
assertNotFalse
(
$new
);
$this
->
assertSame
(
'application/pdf'
,
$new
->
get_mimetype
());
$this
->
assertGreaterThan
(
0
,
$new
->
get_filesize
());
$this
->
assertNotEquals
(
$result
->
get_id
(),
$new
->
get_id
());
// Note: We cannot compare contenthash for PDF because the PDF has a unique ID, and a creation timestamp
// imprinted in the file.
}
/**
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment