getProtection()->setEditing('forms'); $doc = TestHelperDOCX::getDocument($phpWord); $file = 'word/settings.xml'; $path = '/w:settings/w:documentProtection'; $this->assertTrue($doc->elementExists($path, $file)); } /** * Test compatibility */ public function testCompatibility() { $phpWord = new PhpWord(); $phpWord->getCompatibility()->setOoxmlVersion(15); $doc = TestHelperDOCX::getDocument($phpWord); $file = 'word/settings.xml'; $path = '/w:settings/w:compat/w:compatSetting'; $this->assertTrue($doc->elementExists($path, $file)); $this->assertEquals($phpWord->getCompatibility()->getOoxmlVersion(), 15); } /** * Test even and odd headers */ public function testEvenAndOddHeaders() { $phpWord = new PhpWord(); Settings::setEvenAndOddHeaders(true); $doc = TestHelperDOCX::getDocument($phpWord); $file = 'word/settings.xml'; $path = '/w:settings/w:evenAndOddHeaders'; $this->assertTrue($doc->elementExists($path, $file)); $element = $doc->getElement($path, $file); $this->assertEquals('true', $element->getAttribute('w:val')); } }