@@ -196,6 +196,22 @@ public function testEvenAndOddHeaders()
196
196
$ this ->assertSame ('true ' , $ element ->getAttribute ('w:val ' ));
197
197
}
198
198
199
+ public function testUpdateFields ()
200
+ {
201
+ $ phpWord = new PhpWord ();
202
+ $ phpWord ->getSettings ()->setUpdateFields (true );
203
+
204
+ $ doc = TestHelperDOCX::getDocument ($ phpWord );
205
+
206
+ $ file = 'word/settings.xml ' ;
207
+
208
+ $ path = '/w:settings/w:updateFields ' ;
209
+ $ this ->assertTrue ($ doc ->elementExists ($ path , $ file ));
210
+
211
+ $ element = $ doc ->getElement ($ path , $ file );
212
+ $ this ->assertSame ('true ' , $ element ->getAttribute ('w:val ' ));
213
+ }
214
+
199
215
/**
200
216
* Test zoom percentage
201
217
*/
@@ -274,6 +290,38 @@ public function testRevisionView()
274
290
$ this ->assertEquals ('true ' , $ element ->getAttribute ('w:comments ' ));
275
291
}
276
292
293
+ public function testHideSpellingErrors ()
294
+ {
295
+ $ phpWord = new PhpWord ();
296
+ $ phpWord ->getSettings ()->setHideSpellingErrors (true );
297
+
298
+ $ doc = TestHelperDOCX::getDocument ($ phpWord );
299
+
300
+ $ file = 'word/settings.xml ' ;
301
+
302
+ $ path = '/w:settings/w:hideSpellingErrors ' ;
303
+ $ this ->assertTrue ($ doc ->elementExists ($ path , $ file ));
304
+
305
+ $ element = $ doc ->getElement ($ path , $ file );
306
+ $ this ->assertSame ('true ' , $ element ->getAttribute ('w:val ' ));
307
+ }
308
+
309
+ public function testHideGrammaticalErrors ()
310
+ {
311
+ $ phpWord = new PhpWord ();
312
+ $ phpWord ->getSettings ()->setHideGrammaticalErrors (true );
313
+
314
+ $ doc = TestHelperDOCX::getDocument ($ phpWord );
315
+
316
+ $ file = 'word/settings.xml ' ;
317
+
318
+ $ path = '/w:settings/w:hideGrammaticalErrors ' ;
319
+ $ this ->assertTrue ($ doc ->elementExists ($ path , $ file ));
320
+
321
+ $ element = $ doc ->getElement ($ path , $ file );
322
+ $ this ->assertSame ('true ' , $ element ->getAttribute ('w:val ' ));
323
+ }
324
+
277
325
/**
278
326
* Test track Revisions
279
327
*/
0 commit comments