File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
tests/PhpWord/Writer/Word2007 Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -510,4 +510,25 @@ public function testTextWithAmpersant()
510
510
$ this ->assertTrue ($ doc ->elementExists ('/w:document/w:body/w:p/w:r/w:t ' ));
511
511
$ this ->assertEquals ('this text contains an & (ampersant) ' , $ doc ->getElement ('/w:document/w:body/w:p/w:r/w:t ' )->nodeValue );
512
512
}
513
+
514
+ /**
515
+ * Test ListItemRun paragraph style writing
516
+ */
517
+ public function testListItemRunStyleWriting ()
518
+ {
519
+ $ phpWord = new PhpWord ();
520
+ $ phpWord ->addParagraphStyle ('MyParagraphStyle ' , array ('spaceBefore ' => 400 ));
521
+
522
+ $ section = $ phpWord ->addSection ();
523
+ $ listItemRun = $ section ->addListItemRun (0 , null , 'MyParagraphStyle ' );
524
+ $ listItemRun ->addText ('List item ' );
525
+ $ listItemRun ->addText (' in bold ' , array ('bold ' => true ));
526
+
527
+ $ doc = TestHelperDOCX::getDocument ($ phpWord );
528
+ $ this ->assertFalse ($ doc ->elementExists ('/w:document/w:body/w:p/w:pPr/w:pPr ' ));
529
+ $ this ->assertTrue ($ doc ->elementExists ('/w:document/w:body/w:p/w:pPr/w:pStyle ' ));
530
+ $ this ->assertEquals ('List item ' , $ doc ->getElement ('/w:document/w:body/w:p/w:r[1]/w:t ' )->nodeValue );
531
+ $ this ->assertEquals (' in bold ' , $ doc ->getElement ('/w:document/w:body/w:p/w:r[2]/w:t ' )->nodeValue );
532
+ $ this ->assertTrue ($ doc ->elementExists ('/w:document/w:body/w:p/w:r[2]/w:rPr/w:b ' ));
533
+ }
513
534
}
You can’t perform that action at this time.
0 commit comments