File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed
Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -46,12 +46,12 @@ private function normalizedParams()
4646
4747 foreach ($ this ->params as $ key => $ val )
4848 {
49- switch ($ key ) {
50- case ' File ' :
49+ switch (true ) {
50+ case $ key != ' StoreFile ' && preg_match ( ' / File$/ ' , $ key ) :
5151 $ result [$ key ] = FileParam::build ($ val );
5252 break ;
5353
54- case 'Files ' :
54+ case $ key == 'Files ' :
5555 $ result [$ key ] = $ this ->filesBatch ($ val );
5656 break ;
5757
Original file line number Diff line number Diff line change @@ -159,6 +159,18 @@ public function testChainedConversion()
159159 $ this ->assertEquals ('test.zip ' , $ result ->getFile ()->getFileName ());
160160 }
161161
162+ public function testCompare ()
163+ {
164+ $ params = [
165+ 'File ' => 'examples/files/test.docx ' ,
166+ 'CompareFile ' => 'examples/files/test.docx '
167+ ];
168+
169+ $ result = ConvertApi::convert ('compare ' , $ params );
170+
171+ $ this ->assertEquals ('test.docx ' , $ result ->getFile ()->getFileName ());
172+ }
173+
162174 public function testApiError ()
163175 {
164176 $ params = ['Url ' => 'https://www.w3.org/TR/PNG/iso_8859-1.txt ' ];
You can’t perform that action at this time.
0 commit comments