Example #1
0
 public function testCanGetConvertData()
 {
     $data_out = "datas";
     $mock_process = $this->getMockBuilder('\\Dms\\Convert\\Process')->disableOriginalConstructor()->getMock();
     $mock_process->expects($this->any())->method('setCmd')->will($this->returnValue($mock_process));
     $mock_process->expects($this->any())->method('run')->will($this->returnValue($data_out));
     $convert = new Convert();
     $convert->setProcess($mock_process);
     $convert->setData('fdzefsd');
     $convert->setTmp('.');
     $out = $convert->getConvertData('pdf');
     $this->assertEquals($data_out, $out);
 }
Example #2
0
 /**
  * Convert format file.
  */
 private function convert()
 {
     $convert = new Convert();
     $convert->setData($this->document->getDatas())->setFormat($this->document->getFormat())->setTmp($this->option['convert']['tmp'])->setPage($this->getPage());
     $this->getNewDocument()->setDatas($convert->getConvertData($this->getFormat()));
     $this->getNewDocument()->setEncoding(Document::TYPE_BINARY_STR);
     $this->getNewDocument()->setFormat($this->getFormat());
     $this->getNewDocument()->setPage($this->getPage());
 }