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')); }
/** * @return string */ private function saveAndGetContent() { $path = $this->getRuntimePath('doc.docx'); $this->template->save($path); $doc = new Document($path); return $doc->getContent(); }
/** * @param string $filePath */ public function save($filePath = null) { foreach ($this->docContents as $uri => $docContent) { $this->doc->setContent($docContent->getContent(), $uri); } $this->doc->save($filePath); }