Exemplo n.º 1
0
 public function testSave()
 {
     $doc = new Document($this->getFixturePath('test.docx'));
     $doc->setContent(file_get_contents($this->getFixturePath('simple_document.xml')));
     $doc->save($this->getRuntimePath('new.docx'));
     $this->assertFileExists($this->getRuntimePath('new.docx'));
 }
Exemplo n.º 2
0
 /**
  * @return string
  */
 private function saveAndGetContent()
 {
     $path = $this->getRuntimePath('doc.docx');
     $this->template->save($path);
     $doc = new Document($path);
     return $doc->getContent();
 }
Exemplo n.º 3
0
 /**
  * @param string $filePath
  */
 public function save($filePath = null)
 {
     foreach ($this->docContents as $uri => $docContent) {
         $this->doc->setContent($docContent->getContent(), $uri);
     }
     $this->doc->save($filePath);
 }