File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed
src/PhpWord/Writer/Word2007/Element
tests/PhpWord/Writer/Word2007 Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -78,13 +78,13 @@ public function write()
78
78
*
79
79
* @see http://www.datypic.com/sc/ooxml/t-w_CT_SdtText.html
80
80
* @param \PhpOffice\Common\XMLWriter $xmlWriter
81
- * @param \PhpOffice\PhpWord\Element\SDT $element
82
81
*/
83
- private function writePlainText (XMLWriter $ xmlWriter, SDTElement $ element )
82
+ private function writePlainText (XMLWriter $ xmlWriter )
84
83
{
85
- $ xmlWriter ->startElement (" w:text " );
86
- $ xmlWriter ->endElement (); // w:{$type}
84
+ $ xmlWriter ->startElement (' w:text ' );
85
+ $ xmlWriter ->endElement (); // w:text
87
86
}
87
+
88
88
/**
89
89
* Write combo box.
90
90
*
Original file line number Diff line number Diff line change @@ -387,6 +387,7 @@ public function testSDTElements()
387
387
$ section ->addSDT ('comboBox ' )->setListItems (array ('1 ' => 'Choice 1 ' , '2 ' => 'Choice 2 ' ))->setValue ('select value ' );
388
388
$ section ->addSDT ('dropDownList ' );
389
389
$ section ->addSDT ('date ' )->setAlias ('date_alias ' )->setTag ('my_tag ' );
390
+ $ section ->addSDT ('plainText ' );
390
391
391
392
$ doc = TestHelperDOCX::getDocument ($ phpWord );
392
393
@@ -405,6 +406,8 @@ public function testSDTElements()
405
406
$ this ->assertTrue ($ doc ->elementExists ($ path . '[3]/w:sdt/w:sdtPr/w:date ' ));
406
407
$ this ->assertTrue ($ doc ->elementExists ($ path . '[3]/w:sdt/w:sdtPr/w:alias ' ));
407
408
$ this ->assertTrue ($ doc ->elementExists ($ path . '[3]/w:sdt/w:sdtPr/w:tag ' ));
409
+
410
+ $ this ->assertTrue ($ doc ->elementExists ($ path . '[4]/w:sdt/w:sdtPr/w:text ' ));
408
411
}
409
412
410
413
/**
You can’t perform that action at this time.
0 commit comments