Exemplo n.º 1
0
 /**
  * Decode Document to binary.
  *
  * @throws \Exception
  *
  * @return \Dms\Document\Manager
  */
 public function decode()
 {
     if (null === $this->document) {
         throw new \Exception('Document does not exist');
     }
     if ($this->document->getEncoding() != Document::TYPE_BINARY_STR && $this->document->getSupport() == Document::SUPPORT_DATA_STR) {
         $this->document->setDatas($this->getEncDec($this->document->getEncoding())->decode($this->document->getDatas()));
         $this->document->setEncoding(Document::TYPE_BINARY_STR);
     }
     return $this;
 }
Exemplo n.º 2
0
 public function testCanGetEncodingDefault()
 {
     $document = new Document();
     $enc = $document->getEncoding();
     $this->assertEquals($enc, 'binary');
 }