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()
7878 *
7979 * @see http://www.datypic.com/sc/ooxml/t-w_CT_SdtText.html
8080 * @param \PhpOffice\Common\XMLWriter $xmlWriter
81- * @param \PhpOffice\PhpWord\Element\SDT $element
8281 */
83- private function writePlainText (XMLWriter $ xmlWriter, SDTElement $ element )
82+ private function writePlainText (XMLWriter $ xmlWriter )
8483 {
85- $ xmlWriter ->startElement (" w:text " );
86- $ xmlWriter ->endElement (); // w:{$type}
84+ $ xmlWriter ->startElement (' w:text ' );
85+ $ xmlWriter ->endElement (); // w:text
8786 }
87+
8888 /**
8989 * Write combo box.
9090 *
Original file line number Diff line number Diff line change @@ -387,6 +387,7 @@ public function testSDTElements()
387387 $ section ->addSDT ('comboBox ' )->setListItems (array ('1 ' => 'Choice 1 ' , '2 ' => 'Choice 2 ' ))->setValue ('select value ' );
388388 $ section ->addSDT ('dropDownList ' );
389389 $ section ->addSDT ('date ' )->setAlias ('date_alias ' )->setTag ('my_tag ' );
390+ $ section ->addSDT ('plainText ' );
390391
391392 $ doc = TestHelperDOCX::getDocument ($ phpWord );
392393
@@ -405,6 +406,8 @@ public function testSDTElements()
405406 $ this ->assertTrue ($ doc ->elementExists ($ path . '[3]/w:sdt/w:sdtPr/w:date ' ));
406407 $ this ->assertTrue ($ doc ->elementExists ($ path . '[3]/w:sdt/w:sdtPr/w:alias ' ));
407408 $ 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 ' ));
408411 }
409412
410413 /**
You can’t perform that action at this time.
0 commit comments