setEvenAndOddHeaders(true); $this->assertTrue($oSettings->hasEvenAndOddHeaders()); } /** * HideGrammaticalErrors */ public function testHideGrammaticalErrors() { $oSettings = new Settings(); $oSettings->setHideGrammaticalErrors(true); $this->assertTrue($oSettings->hasHideGrammaticalErrors()); } /** * HideSpellingErrors */ public function testHideSpellingErrors() { $oSettings = new Settings(); $oSettings->setHideSpellingErrors(true); $this->assertTrue($oSettings->hasHideSpellingErrors()); } /** * DocumentProtection */ public function testDocumentProtection() { $oSettings = new Settings(); $oSettings->setDocumentProtection(new Protection()); $this->assertNotNull($oSettings->getDocumentProtection()); $oSettings->getDocumentProtection()->setEditing('trackedChanges'); $this->assertEquals('trackedChanges', $oSettings->getDocumentProtection()->getEditing()); } /** * TrackRevistions */ public function testTrackRevisions() { $oSettings = new Settings(); $oSettings->setTrackRevisions(true); $this->assertTrue($oSettings->hasTrackRevisions()); } /** * DoNotTrackFormatting */ public function testDoNotTrackFormatting() { $oSettings = new Settings(); $oSettings->setDoNotTrackFormatting(true); $this->assertTrue($oSettings->hasDoNotTrackFormatting()); } /** * DoNotTrackMoves */ public function testDoNotTrackMoves() { $oSettings = new Settings(); $oSettings->setDoNotTrackMoves(true); $this->assertTrue($oSettings->hasDoNotTrackMoves()); } /** * ProofState */ public function testProofState() { $proofState = new ProofState(); $proofState->setGrammar(ProofState::CLEAN); $proofState->setSpelling(ProofState::DIRTY); $oSettings = new Settings(); $oSettings->setProofState($proofState); $this->assertNotNull($oSettings->getProofState()); $this->assertEquals(ProofState::CLEAN, $oSettings->getProofState()->getGrammar()); $this->assertEquals(ProofState::DIRTY, $oSettings->getProofState()->getSpelling()); } /** * @expectedException \InvalidArgumentException */ public function testWrongProofStateGrammar() { $proofState = new ProofState(); $proofState->setGrammar('wrong'); } /** * @expectedException \InvalidArgumentException */ public function testWrongProofStateSpelling() { $proofState = new ProofState(); $proofState->setSpelling('wrong'); } /** * Zoom as percentage */ public function testZoomPercentage() { $oSettings = new Settings(); $oSettings->setZoom(75); $this->assertEquals(75, $oSettings->getZoom()); } /** * Zoom as string */ public function testZoomEnum() { $oSettings = new Settings(); $oSettings->setZoom(Zoom::FULL_PAGE); $this->assertEquals('fullPage', $oSettings->getZoom()); } /** * Test Update Fields on update */ public function testUpdateFields() { $oSettings = new Settings(); $oSettings->setUpdateFields(true); $this->assertTrue($oSettings->hasUpdateFields()); } }